color feedback on open popouts

This commit is contained in:
2026-03-26 19:28:52 +01:00
parent 54eb48c0bf
commit 6ee804e849
5 changed files with 36 additions and 27 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ CustomRect {
required property Wrapper popouts required property Wrapper popouts
required property PersistentProperties visibilities 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 implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: timeText.contentWidth + Appearance.padding.normal * 2 implicitWidth: timeText.contentWidth + Appearance.padding.normal * 2
radius: Appearance.rounding.full radius: Appearance.rounding.full
@@ -22,7 +22,7 @@ CustomRect {
id: timeText id: timeText
anchors.centerIn: parent anchors.centerIn: parent
color: DynamicColors.palette.m3onSurface color: root.visibilities.dashboard ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
text: Time.dateStr text: Time.dateStr
Behavior on color { Behavior on color {
+2 -4
View File
@@ -11,7 +11,7 @@ CustomRect {
required property Wrapper popouts required property Wrapper popouts
required property PersistentProperties visibilities 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 implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: implicitHeight implicitWidth: implicitHeight
radius: Appearance.rounding.full radius: Appearance.rounding.full
@@ -19,10 +19,8 @@ CustomRect {
MaterialIcon { MaterialIcon {
id: notificationCenterIcon id: notificationCenterIcon
property color iconColor: DynamicColors.palette.m3onSurface
anchors.centerIn: parent anchors.centerIn: parent
color: iconColor color: root.visibilities.sidebar ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
font.family: "Material Symbols Rounded" font.family: "Material Symbols Rounded"
font.pointSize: Appearance.font.size.larger font.pointSize: Appearance.font.size.larger
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4" text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
+2 -1
View File
@@ -12,6 +12,7 @@ RowLayout {
readonly property real arcStartAngle: 0.75 * Math.PI readonly property real arcStartAngle: 0.75 * Math.PI
readonly property real arcSweep: 1.5 * Math.PI readonly property real arcSweep: 1.5 * Math.PI
property string icon property string icon
required property color iconColor
required property color mainColor required property color mainColor
required property double percentage required property double percentage
property bool shown: true property bool shown: true
@@ -37,7 +38,7 @@ RowLayout {
MaterialIcon { MaterialIcon {
id: icon id: icon
color: DynamicColors.palette.m3onSurface color: root.iconColor
font.pointSize: Appearance.font.size.larger font.pointSize: Appearance.font.size.larger
text: root.icon text: root.icon
} }
+9 -5
View File
@@ -14,7 +14,7 @@ CustomRect {
required property PersistentProperties visibilities required property PersistentProperties visibilities
clip: true clip: true
color: DynamicColors.tPalette.m3surfaceContainer color: visibilities.resources ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2 implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitWidth: rowLayout.implicitWidth + Appearance.padding.normal * 2 implicitWidth: rowLayout.implicitWidth + Appearance.padding.normal * 2
radius: height / 2 radius: height / 2
@@ -38,7 +38,8 @@ CustomRect {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true Layout.fillHeight: true
icon: "memory" 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 percentage: SystemUsage.cpuPerc
warningThreshold: 95 warningThreshold: 95
} }
@@ -46,7 +47,8 @@ CustomRect {
Resource { Resource {
Layout.fillHeight: true Layout.fillHeight: true
icon: "memory_alt" 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 percentage: SystemUsage.memPerc
warningThreshold: 80 warningThreshold: 80
} }
@@ -54,14 +56,16 @@ CustomRect {
Resource { Resource {
Layout.fillHeight: true Layout.fillHeight: true
icon: "gamepad" 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 percentage: SystemUsage.gpuPerc
} }
Resource { Resource {
Layout.fillHeight: true Layout.fillHeight: true
icon: "developer_board" 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 percentage: SystemUsage.gpuMemUsed
} }
} }
+21 -15
View File
@@ -9,29 +9,35 @@ import qs.Config
Item { Item {
id: root id: root
property bool current: popouts.currentName.startsWith(`traymenu${ind}`) && popouts.hasCurrent
property bool hasLoaded: false property bool hasLoaded: false
required property int ind required property int ind
required property SystemTrayItem item required property SystemTrayItem item
required property RowLayout loader required property RowLayout loader
required property Wrapper popouts required property Wrapper popouts
StateLayer { CustomRect {
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent anchors.fill: parent
anchors.margins: 3 anchors.margins: 3
radius: 6 color: root.current ? DynamicColors.palette.m3primary : "transparent"
radius: Appearance.rounding.full
onClicked: { StateLayer {
if (mouse.button === Qt.LeftButton) { acceptedButtons: Qt.LeftButton | Qt.RightButton
root.item.activate(); anchors.fill: parent
} else if (mouse.button === Qt.RightButton) {
root.popouts.currentName = `traymenu${root.ind}`; onClicked: {
root.popouts.currentCenter = Qt.binding(() => root.mapToItem(root.loader, root.implicitWidth / 2, 0).x); if (mouse.button === Qt.LeftButton) {
root.popouts.hasCurrent = true; root.item.activate();
if (visibilities.sidebar || visibilities.dashboard || visibilities.settings) { } else if (mouse.button === Qt.RightButton) {
visibilities.sidebar = false; root.popouts.currentName = `traymenu${root.ind}`;
visibilities.dashboard = false; root.popouts.currentCenter = Qt.binding(() => root.mapToItem(root.loader, root.implicitWidth / 2, 0).x);
visibilities.settings = false; 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 id: icon
anchors.centerIn: parent anchors.centerIn: parent
color: DynamicColors.palette.m3onSurface color: root.current ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
implicitSize: 22 implicitSize: 22
layer.enabled: Config.general.color.smart || Config.general.color.scheduleDark layer.enabled: Config.general.color.smart || Config.general.color.scheduleDark
source: root.item.icon source: root.item.icon