diff --git a/components/LucideIcon.qml b/components/LucideIcon.qml index aa73b88..8788c0d 100644 --- a/components/LucideIcon.qml +++ b/components/LucideIcon.qml @@ -4,7 +4,6 @@ import QtQuick Text { font.family: Styling.lucide.font.family font.pixelSize: 16 - color: Styling.theme.basecontent Behavior on color { ColorAnimation { diff --git a/components/MprisController.qml b/components/MprisController.qml index 265d045..4ad8be0 100644 --- a/components/MprisController.qml +++ b/components/MprisController.qml @@ -14,35 +14,43 @@ Loader { active: player != null sourceComponent: ColumnLayout { - spacing: 12 + spacing: Styling.layout.spacing.xl implicitWidth: 800 StyledText { id: text + Layout.alignment: Qt.AlignHCenter - text: `${root.player.trackTitle} - ${root.player.trackArtist}` + font.pixelSize: Styling.typography.textSize.base + text: `${root.player.trackTitle} - ${root.player.trackArtist}` } RowLayout { Layout.alignment: Qt.AlignHCenter StyledIconButton { id: backButton + text: Styling.lucide.icons.skipBack + onClicked: { root.player.previous(); } } StyledIconButton { id: playPauseButton + text: root.player.isPlaying ? Styling.lucide.icons.pause : Styling.lucide.icons.play + onClicked: { root.player.isPlaying = !root.player.isPlaying; } } StyledIconButton { id: forwardButton + text: Styling.lucide.icons.skipForward + onClicked: { root.player.next(); } @@ -51,21 +59,24 @@ Loader { StyledText { Layout.alignment: Qt.AlignHCenter + + font.pixelSize: Styling.typography.textSize.sm text: { function formatTime(num) { return Math.floor(num).toString().padStart(2, "0"); } return `${formatTime(root.player.position / 60)}:${formatTime(root.player.position % 60)} - ${formatTime(root.player.length / 60)}:${formatTime(root.player.length % 60)}`; } - font.pixelSize: Styling.typography.textSize.sm } StyledSlider { + Layout.fillWidth: true + from: 0 to: root.player.length ?? 0 value: root.player.position implicitHeight: 6 - Layout.fillWidth: true + onMoved: { root.player.position = value; } diff --git a/components/MprisPlayerSelector.qml b/components/MprisPlayerSelector.qml index 2a4a8c3..bd81afc 100644 --- a/components/MprisPlayerSelector.qml +++ b/components/MprisPlayerSelector.qml @@ -5,7 +5,7 @@ import QtQuick import QtQuick.Layouts RowLayout { - spacing: 8 + spacing: Styling.layout.spacing.xl Layout.alignment: Qt.AlignHCenter @@ -21,6 +21,7 @@ RowLayout { } StyledText { + font.pixelSize: Styling.typography.textSize.xl text: { if (!Mpris.active) { return "inactive"; @@ -35,7 +36,6 @@ RowLayout { } return displayName; } - font.pixelSize: 20 } StyledIconButton { diff --git a/components/StyledButton.qml b/components/StyledButton.qml index bfe817f..bd86cb0 100644 --- a/components/StyledButton.qml +++ b/components/StyledButton.qml @@ -7,7 +7,7 @@ Button { property alias border: rectangle.border property alias radius: rectangle.radius - font.pixelSize: 14 + font.pixelSize: Styling.typography.textSize.base verticalPadding: 6 horizontalPadding: 8 @@ -33,6 +33,6 @@ Button { background: Rectangle { id: rectangle color: root.palette.button - radius: 8 + radius: Styling.theme.radiusField } } diff --git a/components/StyledIconButton.qml b/components/StyledIconButton.qml index 5a91ff4..f9fbd84 100644 --- a/components/StyledIconButton.qml +++ b/components/StyledIconButton.qml @@ -11,7 +11,7 @@ RoundButton { font.family: Styling.lucide.font.family font.pixelSize: 16 - radius: 8 + radius: Styling.theme.radiusField padding: 8 HoverHandler { diff --git a/components/StyledLabel.qml b/components/StyledLabel.qml index a1f429d..3682786 100644 --- a/components/StyledLabel.qml +++ b/components/StyledLabel.qml @@ -5,7 +5,7 @@ import Quickshell.Widgets WrapperRectangle { id: root margin: 8 - radius: 8 + radius: Styling.theme.radiusBox color: Styling.theme.base200 Behavior on color { ColorAnimation { diff --git a/components/StyledProgressBar.qml b/components/StyledProgressBar.qml index d40d8ba..6075b4d 100644 --- a/components/StyledProgressBar.qml +++ b/components/StyledProgressBar.qml @@ -16,7 +16,7 @@ ProgressBar { implicitWidth: 200 implicitHeight: 6 color: Styling.theme.base100 - radius: 8 + radius: Styling.theme.radiusField } contentItem: Item { @@ -27,7 +27,7 @@ ProgressBar { Rectangle { width: control.visualPosition * parent.width height: parent.height - radius: 8 + radius: Styling.theme.radiusField color: Styling.theme.primary visible: !control.indeterminate } diff --git a/components/StyledSlider.qml b/components/StyledSlider.qml index fc1df87..34d0633 100644 --- a/components/StyledSlider.qml +++ b/components/StyledSlider.qml @@ -18,7 +18,7 @@ Slider { implicitHeight: control.height width: control.availableWidth height: implicitHeight - radius: 8 + radius: Styling.theme.radiusField color: Styling.theme.base200 Rectangle { @@ -30,7 +30,7 @@ Slider { } height: parent.height color: Styling.theme.primary - radius: 8 + radius: Styling.theme.radiusField } } handle: null diff --git a/components/StyledSwitch.qml b/components/StyledSwitch.qml index 06dd4e8..7d909ac 100644 --- a/components/StyledSwitch.qml +++ b/components/StyledSwitch.qml @@ -29,7 +29,7 @@ Switch { implicitHeight: 24 x: control.width - width - control.rightPadding y: parent.height / 2 - height / 2 - radius: 16 + radius: Styling.theme.radiusSelector color: "transparent" border.color: control.checked ? Styling.theme.primary : Styling.theme.basecontent border.width: 2 @@ -45,7 +45,7 @@ Switch { } width: parent.width / 2 - indicator.padding height: parent.height - indicator.padding - radius: 16 + radius: Styling.theme.radiusSelector color: control.checked ? Styling.theme.primary : Styling.theme.basecontent } } diff --git a/components/StyledToolTip.qml b/components/StyledToolTip.qml index 8fa2b0b..9015122 100644 --- a/components/StyledToolTip.qml +++ b/components/StyledToolTip.qml @@ -13,9 +13,9 @@ ToolTip { } background: Rectangle { - radius: 8 + radius: Styling.theme.radiusBox color: Styling.theme.base100 border.color: Styling.theme.base200 - border.width: 2 + border.width: Styling.theme.border } } diff --git a/components/StyledWrapperRectangle.qml b/components/StyledWrapperRectangle.qml index b6c3eba..25dd7d5 100644 --- a/components/StyledWrapperRectangle.qml +++ b/components/StyledWrapperRectangle.qml @@ -3,7 +3,7 @@ import QtQuick import Quickshell.Widgets WrapperRectangle { - radius: 8 + radius: Styling.theme.radiusBox color: Styling.theme.base100 Behavior on color { ColorAnimation { diff --git a/config/Dimensions.qml b/config/Dimensions.qml deleted file mode 100644 index 6298414..0000000 --- a/config/Dimensions.qml +++ /dev/null @@ -1,22 +0,0 @@ -pragma Singleton - -import QtQuick -import Quickshell - -Singleton { - id: root - - property int radius: 8 - - property Bar bar: Bar {} - - component Bar: QtObject { - property int spacing: 8 - property int border: 2 - property int height: 50 - property int verticalMargins: 4 - property int horizontalMargins: 8 - property int verticalPadding: 2 - property int horizontalPadding: 8 - } -} diff --git a/config/Styling.qml b/config/Styling.qml index 467268d..71127b8 100644 --- a/config/Styling.qml +++ b/config/Styling.qml @@ -8,6 +8,7 @@ Singleton { readonly property Animations animations: Animations {} readonly property Typography typography: Typography {} + readonly property Layout layout: Layout {} readonly property var theme: Theme.palette readonly property Lucide lucide: Lucide {} @@ -33,6 +34,16 @@ Singleton { readonly property int xl: 24 } + component Layout: QtObject { + readonly property LayoutSpacing spacing: LayoutSpacing {} + } + component LayoutSpacing: QtObject { + readonly property int sm: 2 + readonly property int base: 4 + readonly property int lg: 8 + readonly property int xl: 12 + } + component Lucide: Item { readonly property alias font: loader.font diff --git a/config/Theme.qml b/config/Theme.qml index e54b66e..596c9ac 100644 --- a/config/Theme.qml +++ b/config/Theme.qml @@ -86,6 +86,11 @@ Singleton { property color warningcontent: "#793205" property color error: "#ff627d" property color errorcontent: "#4d0218" + + property int radiusSelector: 8 + property int radiusField: 8 + property int radiusBox: 8 + property int border: 2 } } } diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 4aff347..98d2aba 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -16,7 +16,7 @@ PanelWindow { anchors.left: true anchors.right: true - implicitHeight: Dimensions.bar.height + implicitHeight: 50 color: 'transparent' WlrLayershell.layer: WlrLayer.Top @@ -24,20 +24,20 @@ PanelWindow { Item { anchors.fill: parent - anchors.leftMargin: Dimensions.bar.horizontalMargins - anchors.rightMargin: Dimensions.bar.horizontalMargins - anchors.topMargin: Dimensions.bar.verticalMargins - anchors.bottomMargin: Dimensions.bar.verticalMargins + anchors.leftMargin: 8 + anchors.rightMargin: 8 + anchors.topMargin: 4 + anchors.bottomMargin: 4 Rectangle { id: background anchors.fill: parent color: Styling.theme.base100 - radius: Dimensions.radius + radius: Styling.theme.radiusBox border { color: Styling.theme.base200 - width: Dimensions.bar.border + width: Styling.theme.border pixelAligned: true } } @@ -48,11 +48,11 @@ PanelWindow { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Dimensions.bar.horizontalPadding - anchors.topMargin: Dimensions.bar.verticalPadding - anchors.bottomMargin: Dimensions.bar.verticalPadding + anchors.leftMargin: 8 + anchors.topMargin: 4 + anchors.bottomMargin: 4 - spacing: Dimensions.bar.spacing + spacing: Styling.layout.spacing.base SystemLogo { implicitSize: 22 @@ -69,10 +69,10 @@ PanelWindow { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - anchors.topMargin: Dimensions.bar.verticalPadding - anchors.bottomMargin: Dimensions.bar.verticalPadding + anchors.topMargin: 4 + anchors.bottomMargin: 4 - spacing: Dimensions.bar.spacing + spacing: Styling.layout.spacing.base Mpris {} } @@ -83,11 +83,11 @@ PanelWindow { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.rightMargin: Dimensions.bar.horizontalPadding - anchors.topMargin: Dimensions.bar.verticalPadding - anchors.bottomMargin: Dimensions.bar.verticalPadding + anchors.rightMargin: 8 + anchors.topMargin: 4 + anchors.bottomMargin: 4 - spacing: Dimensions.bar.spacing + spacing: Styling.layout.spacing.base Pywal {} diff --git a/modules/launcher/items/AppItem.qml b/modules/launcher/items/AppItem.qml index a9437c0..8ef6c46 100644 --- a/modules/launcher/items/AppItem.qml +++ b/modules/launcher/items/AppItem.qml @@ -43,7 +43,6 @@ Item { Layout.alignment: Qt.AlignBottom Layout.fillWidth: true color: root.active ? Styling.theme.primarycontent : Styling.theme.basecontent - font.pixelSize: 14 font.bold: true } @@ -53,7 +52,7 @@ Item { Layout.alignment: Qt.AlignTop Layout.fillWidth: true color: root.active ? Styling.theme.primarycontent : Styling.theme.basecontent - font.pixelSize: 10 + font.pixelSize: Styling.typography.textSize.sm elide: Text.ElideRight } } diff --git a/modules/powermenu/PowerMenu.qml b/modules/powermenu/PowerMenu.qml index dee8827..e204b20 100644 --- a/modules/powermenu/PowerMenu.qml +++ b/modules/powermenu/PowerMenu.qml @@ -28,7 +28,6 @@ StyledWindow { id: rect margin: 14 - radius: 8 HyprlandFocusGrab { active: Visibility.powermenu @@ -67,7 +66,7 @@ StyledWindow { model: Config.powermenu.actions - spacing: 8 + spacing: Styling.layout.spacing.base implicitWidth: 220 implicitHeight: 185 @@ -105,7 +104,7 @@ StyledWindow { padding: 16 color: list.currentIndex == index ? Styling.theme.primarycontent : Styling.theme.basecontent text: modelData.text - font.pixelSize: 18 + font.pixelSize: Styling.typography.textSize.lg font.bold: true } }