From 6ee804e849987791192f271a90c2e48a034be4f2 Mon Sep 17 00:00:00 2001 From: zach Date: Thu, 26 Mar 2026 19:28:52 +0100 Subject: [PATCH] color feedback on open popouts --- Modules/Clock.qml | 4 ++-- Modules/NotifBell.qml | 6 ++---- Modules/Resource.qml | 3 ++- Modules/Resources.qml | 14 +++++++++----- Modules/TrayItem.qml | 36 +++++++++++++++++++++--------------- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/Modules/Clock.qml b/Modules/Clock.qml index 78dd270..c69e2c1 100644 --- a/Modules/Clock.qml +++ b/Modules/Clock.qml @@ -13,7 +13,7 @@ CustomRect { required property Wrapper popouts required property PersistentProperties visibilities - color: DynamicColors.tPalette.m3surfaceContainer + color: visibilities.dashboard ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2 implicitWidth: timeText.contentWidth + Appearance.padding.normal * 2 radius: Appearance.rounding.full @@ -22,7 +22,7 @@ CustomRect { id: timeText anchors.centerIn: parent - color: DynamicColors.palette.m3onSurface + color: root.visibilities.dashboard ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface text: Time.dateStr Behavior on color { diff --git a/Modules/NotifBell.qml b/Modules/NotifBell.qml index 7ddd506..e59f4f0 100644 --- a/Modules/NotifBell.qml +++ b/Modules/NotifBell.qml @@ -11,7 +11,7 @@ CustomRect { required property Wrapper popouts required property PersistentProperties visibilities - color: DynamicColors.tPalette.m3surfaceContainer + color: visibilities.sidebar ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2 implicitWidth: implicitHeight radius: Appearance.rounding.full @@ -19,10 +19,8 @@ CustomRect { MaterialIcon { id: notificationCenterIcon - property color iconColor: DynamicColors.palette.m3onSurface - anchors.centerIn: parent - color: iconColor + color: root.visibilities.sidebar ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface font.family: "Material Symbols Rounded" font.pointSize: Appearance.font.size.larger text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4" diff --git a/Modules/Resource.qml b/Modules/Resource.qml index 43c4561..9d7842d 100644 --- a/Modules/Resource.qml +++ b/Modules/Resource.qml @@ -12,6 +12,7 @@ RowLayout { readonly property real arcStartAngle: 0.75 * Math.PI readonly property real arcSweep: 1.5 * Math.PI property string icon + required property color iconColor required property color mainColor required property double percentage property bool shown: true @@ -37,7 +38,7 @@ RowLayout { MaterialIcon { id: icon - color: DynamicColors.palette.m3onSurface + color: root.iconColor font.pointSize: Appearance.font.size.larger text: root.icon } diff --git a/Modules/Resources.qml b/Modules/Resources.qml index e90100a..0ded577 100644 --- a/Modules/Resources.qml +++ b/Modules/Resources.qml @@ -14,7 +14,7 @@ CustomRect { required property PersistentProperties visibilities clip: true - color: DynamicColors.tPalette.m3surfaceContainer + color: visibilities.resources ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2 implicitWidth: rowLayout.implicitWidth + Appearance.padding.normal * 2 radius: height / 2 @@ -38,7 +38,8 @@ CustomRect { Layout.alignment: Qt.AlignVCenter Layout.fillHeight: true icon: "memory" - mainColor: DynamicColors.palette.m3primary + iconColor: root.visibilities.resources ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface + mainColor: root.visibilities.resources ? DynamicColors.palette.m3primaryContainer : DynamicColors.palette.m3primary percentage: SystemUsage.cpuPerc warningThreshold: 95 } @@ -46,7 +47,8 @@ CustomRect { Resource { Layout.fillHeight: true icon: "memory_alt" - mainColor: DynamicColors.palette.m3secondary + iconColor: root.visibilities.resources ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface + mainColor: root.visibilities.resources ? DynamicColors.palette.m3secondaryContainer : DynamicColors.palette.m3secondary percentage: SystemUsage.memPerc warningThreshold: 80 } @@ -54,14 +56,16 @@ CustomRect { Resource { Layout.fillHeight: true icon: "gamepad" - mainColor: DynamicColors.palette.m3tertiary + iconColor: root.visibilities.resources ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface + mainColor: root.visibilities.resources ? DynamicColors.palette.m3tertiaryContainer : DynamicColors.palette.m3tertiary percentage: SystemUsage.gpuPerc } Resource { Layout.fillHeight: true icon: "developer_board" - mainColor: DynamicColors.palette.m3primary + iconColor: root.visibilities.resources ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface + mainColor: root.visibilities.resources ? DynamicColors.palette.m3primaryContainer : DynamicColors.palette.m3primary percentage: SystemUsage.gpuMemUsed } } diff --git a/Modules/TrayItem.qml b/Modules/TrayItem.qml index 263c8d9..60fd9ce 100644 --- a/Modules/TrayItem.qml +++ b/Modules/TrayItem.qml @@ -9,29 +9,35 @@ import qs.Config Item { id: root + property bool current: popouts.currentName.startsWith(`traymenu${ind}`) && popouts.hasCurrent property bool hasLoaded: false required property int ind required property SystemTrayItem item required property RowLayout loader required property Wrapper popouts - StateLayer { - acceptedButtons: Qt.LeftButton | Qt.RightButton + CustomRect { anchors.fill: parent anchors.margins: 3 - radius: 6 + color: root.current ? DynamicColors.palette.m3primary : "transparent" + radius: Appearance.rounding.full - onClicked: { - if (mouse.button === Qt.LeftButton) { - root.item.activate(); - } else if (mouse.button === Qt.RightButton) { - root.popouts.currentName = `traymenu${root.ind}`; - root.popouts.currentCenter = Qt.binding(() => root.mapToItem(root.loader, root.implicitWidth / 2, 0).x); - root.popouts.hasCurrent = true; - if (visibilities.sidebar || visibilities.dashboard || visibilities.settings) { - visibilities.sidebar = false; - visibilities.dashboard = false; - visibilities.settings = false; + StateLayer { + acceptedButtons: Qt.LeftButton | Qt.RightButton + anchors.fill: parent + + onClicked: { + if (mouse.button === Qt.LeftButton) { + root.item.activate(); + } else if (mouse.button === Qt.RightButton) { + root.popouts.currentName = `traymenu${root.ind}`; + root.popouts.currentCenter = Qt.binding(() => root.mapToItem(root.loader, root.implicitWidth / 2, 0).x); + root.popouts.hasCurrent = true; + if (visibilities.sidebar || visibilities.dashboard || visibilities.settings) { + visibilities.sidebar = false; + visibilities.dashboard = false; + visibilities.settings = false; + } } } } @@ -41,7 +47,7 @@ Item { id: icon anchors.centerIn: parent - color: DynamicColors.palette.m3onSurface + color: root.current ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface implicitSize: 22 layer.enabled: Config.general.color.smart || Config.general.color.scheduleDark source: root.item.icon -- 2.47.3