diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-05 14:50:18 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-05 14:50:18 +1000 |
| commit | 1fdaf24526ae688251307f2756bcdb9d7592e383 (patch) | |
| tree | 9187b1efd11bfa7d1d2625da29c308a6a51c2842 /modules/bar | |
| parent | dev: get rid of wrapper width/height = 0 warnings (diff) | |
| download | caelestia-shell-1fdaf24526ae688251307f2756bcdb9d7592e383.tar.gz caelestia-shell-1fdaf24526ae688251307f2756bcdb9d7592e383.tar.bz2 caelestia-shell-1fdaf24526ae688251307f2756bcdb9d7592e383.zip | |
refactor: move colours to separate service
Diffstat (limited to 'modules/bar')
| -rw-r--r-- | modules/bar/Panel.qml | 27 | ||||
| -rw-r--r-- | modules/bar/Pills.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/ActiveWindow.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/Clock.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/OsIcon.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/Power.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/StatusIcons.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/Tray.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/ActiveIndicator.qml | 2 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/OccupiedBg.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspace.qml | 4 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspaces.qml | 2 |
12 files changed, 30 insertions, 25 deletions
diff --git a/modules/bar/Panel.qml b/modules/bar/Panel.qml index 741fa13..9dd5797 100644 --- a/modules/bar/Panel.qml +++ b/modules/bar/Panel.qml @@ -1,4 +1,5 @@ import "root:/widgets" +import "root:/services" import "root:/config" import "components" import "components/workspaces" @@ -16,7 +17,7 @@ StyledRect { } vertical: BarConfig.vertical - color: Appearance.alpha(Appearance.colours.m3surface, false) + color: Colours.alpha(Colours.palette.m3surface, false) anchors.fill: parent BoxLayout { @@ -28,10 +29,10 @@ StyledRect { spacing: 0 Module { - color: Appearance.colours.mauve + color: Colours.palette.mauve OsIcon { - color: Appearance.on(Appearance.colours.mauve) + color: Colours.on(Colours.palette.mauve) anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) @@ -39,10 +40,10 @@ StyledRect { } Module { - color: Appearance.colours.pink + color: Colours.palette.pink ActiveWindow { - colour: Appearance.on(Appearance.colours.pink) + colour: Colours.on(Colours.palette.pink) anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) @@ -76,10 +77,10 @@ StyledRect { } Module { - color: Appearance.colours.green + color: Colours.palette.green Clock { - colour: Appearance.on(Appearance.colours.green) + colour: Colours.on(Colours.palette.green) anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) @@ -87,10 +88,10 @@ StyledRect { } Module { - color: Appearance.colours.yellow + color: Colours.palette.yellow Tray { - colour: Appearance.on(Appearance.colours.yellow) + colour: Colours.on(Colours.palette.yellow) anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) @@ -98,10 +99,10 @@ StyledRect { } Module { - color: Appearance.colours.peach + color: Colours.palette.peach StatusIcons { - colour: Appearance.on(Appearance.colours.peach) + colour: Colours.on(Colours.palette.peach) anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) @@ -109,7 +110,7 @@ StyledRect { } Module { - color: Appearance.colours.m3error + color: Colours.palette.m3error Layout.maximumWidth: BarConfig.sizes.height Layout.maximumHeight: BarConfig.sizes.height @@ -118,7 +119,7 @@ StyledRect { x: (BarConfig.sizes.height - width) / 2 y: (BarConfig.sizes.height - height) / 2 - color: Appearance.colours.m3onError + color: Colours.palette.m3onError anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) anchors.verticalCenter: root.get(parent.verticalCenter, undefined) diff --git a/modules/bar/Pills.qml b/modules/bar/Pills.qml index bb9d08f..7af9d6d 100644 --- a/modules/bar/Pills.qml +++ b/modules/bar/Pills.qml @@ -125,7 +125,7 @@ BoxLayout { } component Pill: PaddedRect { - color: Appearance.alpha(Appearance.colours.m3surface, false) + color: Colours.alpha(Colours.palette.m3surface, false) radius: Appearance.rounding.full padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large] diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml index de568dd..eeea3ac 100644 --- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -9,7 +9,7 @@ import QtQuick StyledRect { id: root - property color colour: Appearance.colours.pink + property color colour: Colours.palette.pink animate: true clip: true diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index f3e3701..3397222 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -6,7 +6,7 @@ import QtQuick StyledRect { id: root - property color colour: Appearance.colours.peach + property color colour: Colours.palette.peach MaterialIcon { id: icon diff --git a/modules/bar/components/OsIcon.qml b/modules/bar/components/OsIcon.qml index 0daa945..ce7d51b 100644 --- a/modules/bar/components/OsIcon.qml +++ b/modules/bar/components/OsIcon.qml @@ -1,4 +1,5 @@ import "root:/widgets" +import "root:/services" import "root:/utils" import "root:/config" @@ -6,5 +7,5 @@ StyledText { text: Icons.osIcon font.pointSize: Appearance.font.size.smaller font.family: Appearance.font.family.mono - color: Appearance.colours.yellow + color: Colours.palette.yellow } diff --git a/modules/bar/components/Power.qml b/modules/bar/components/Power.qml index 1124a55..7584747 100644 --- a/modules/bar/components/Power.qml +++ b/modules/bar/components/Power.qml @@ -1,9 +1,10 @@ import "root:/widgets" +import "root:/services" import "root:/config" MaterialIcon { text: "power_settings_new" - color: Appearance.colours.m3error + color: Colours.palette.m3error font.bold: true font.pointSize: Appearance.font.size.normal } diff --git a/modules/bar/components/StatusIcons.qml b/modules/bar/components/StatusIcons.qml index 2721cc9..cb5dc58 100644 --- a/modules/bar/components/StatusIcons.qml +++ b/modules/bar/components/StatusIcons.qml @@ -8,7 +8,7 @@ import QtQuick StyledRect { id: root - property color colour: Appearance.colours.rosewater + property color colour: Colours.palette.rosewater animate: true clip: true diff --git a/modules/bar/components/Tray.qml b/modules/bar/components/Tray.qml index 98a7dfe..a635b76 100644 --- a/modules/bar/components/Tray.qml +++ b/modules/bar/components/Tray.qml @@ -1,4 +1,5 @@ import "root:/widgets" +import "root:/services" import "root:/config" import Quickshell.Services.SystemTray import QtQuick @@ -6,7 +7,7 @@ import QtQuick StyledRect { id: root - property color colour: Appearance.colours.lavender + property color colour: Colours.palette.lavender animate: true clip: true diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml index 2d43f19..a9d3e60 100644 --- a/modules/bar/components/workspaces/ActiveIndicator.qml +++ b/modules/bar/components/workspaces/ActiveIndicator.qml @@ -33,7 +33,7 @@ Rectangle { visible: false anchors.fill: parent - color: Appearance.on(root.color) + color: Colours.on(root.color) Behavior on color { ColorAnimation { diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index ccbc75f..ae9c333 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -1,6 +1,7 @@ pragma ComponentBehavior: Bound import "root:/widgets" +import "root:/services" import "root:/config" import Quickshell import QtQuick @@ -51,7 +52,7 @@ Item { readonly property Workspace start: root.workspaces[modelData.start - 1 - root.groupOffset] ?? null readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null - color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true) + color: Colours.alpha(Colours.palette.m3surfaceContainerHigh, true) radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0 x: start?.x ?? 0 diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index 9edc8e4..7f4bc68 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -34,7 +34,7 @@ Item { animate: true text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label - color: BarConfig.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Appearance.colours.m3onSurface : Appearance.colours.m3outlineVariant + color: BarConfig.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.palette.m3outlineVariant horizontalAlignment: StyledText.AlignHCenter verticalAlignment: StyledText.AlignVCenter @@ -63,7 +63,7 @@ Item { required property Hyprland.Client modelData text: Icons.getAppCategoryIcon(modelData.wmClass, "terminal") - color: Appearance.colours.m3onSurfaceVariant + color: Colours.palette.m3onSurfaceVariant } } } diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index b2def7e..738f679 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -9,7 +9,7 @@ Item { id: root property alias vertical: layout.vertical - property color colour: Appearance.colours.mauve + property color colour: Colours.palette.mauve readonly property list<Workspace> workspaces: layout.children.filter(c => c.isWorkspace).sort((w1, w2) => w1.ws - w2.ws) readonly property var occupied: Hyprland.workspaces.values.reduce((acc, curr) => { |