diff --git a/shell/Commons/Style.qml b/shell/Commons/Style.qml index 415f8cb5..2baa023b 100644 --- a/shell/Commons/Style.qml +++ b/shell/Commons/Style.qml @@ -31,10 +31,10 @@ QtObject { readonly property color focusFillColor: Qt.rgba(Color.accent.r, Color.accent.g, Color.accent.b, 0.22) readonly property int focusBorderWidth: 3 - // Convenience: the standard "hot" (hover or keyboard cursor) tint used by - // PillButton, PanelActionButton, etc. Foreground at 0.12 alpha matches the - // value PillButton was already painting before promotion. - readonly property color hotFill: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.12) + // Convenience fills used by panel rows and pills. Hot is hover/keyboard + // cursor; selected is the persistent chosen/current item state. + readonly property color hotFill: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.08) + readonly property color selectedFill: Qt.rgba(Color.foreground.r, Color.foreground.g, Color.foreground.b, 0.18) function refresh() { hyprctlProc.running = true diff --git a/shell/Ui/ChoiceButton.qml b/shell/Ui/ChoiceButton.qml index 83ffcbe9..c006f01d 100644 --- a/shell/Ui/ChoiceButton.qml +++ b/shell/Ui/ChoiceButton.qml @@ -43,7 +43,7 @@ Rectangle { color: selected ? Qt.rgba(accent.r, accent.g, accent.b, 0.18) - : ((mouse.containsMouse || hasCursor) ? Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12) : background) + : ((mouse.containsMouse || hasCursor) ? Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08) : background) border.color: selected ? accent : (activeFocus ? foreground : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.4)) diff --git a/shell/Ui/CursorSurface.qml b/shell/Ui/CursorSurface.qml index 92ad4e50..a2ac5c0e 100644 --- a/shell/Ui/CursorSurface.qml +++ b/shell/Ui/CursorSurface.qml @@ -13,8 +13,8 @@ Rectangle { property bool current: false property color foreground: "#cacccc" - property color fill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12) - property color currentFill: fill + property color fill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08) + property color currentFill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.18) radius: Style.cornerRadius color: hasCursor ? fill : (current ? currentFill : "transparent") diff --git a/shell/Ui/PillButton.qml b/shell/Ui/PillButton.qml index 21218bef..cf5bdc49 100644 --- a/shell/Ui/PillButton.qml +++ b/shell/Ui/PillButton.qml @@ -10,7 +10,7 @@ Rectangle { property string tooltipText: "" property color foreground: "#cacccc" property color background: "transparent" - property color hoverBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12) + property color hoverBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08) property color pressedBackground: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.22) property color tooltipBackground: "#101315" property color tooltipForeground: foreground diff --git a/shell/Ui/Toggle.qml b/shell/Ui/Toggle.qml index 5b3cd0da..e1ff9ba6 100644 --- a/shell/Ui/Toggle.qml +++ b/shell/Ui/Toggle.qml @@ -48,13 +48,13 @@ Rectangle { implicitWidth: 240 radius: Style.cornerRadius - color: activeFocus || hasCursor + color: activeFocus ? Style.focusFillColor - : (mouse.containsMouse ? Style.hotFill : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.03)) - border.color: activeFocus || hasCursor + : ((hasCursor || mouse.containsMouse) ? Qt.rgba(foreground.r, foreground.g, foreground.b, 0.08) : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.03)) + border.color: activeFocus ? Style.focusBorderColor : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.12) - border.width: activeFocus || hasCursor ? Style.focusBorderWidth : 1 + border.width: activeFocus ? Style.focusBorderWidth : 1 Behavior on color { ColorAnimation { duration: 100 } } diff --git a/shell/plugins/bar/widgets/audioPanel.qml b/shell/plugins/bar/widgets/audioPanel.qml index cb457b50..442aeeb3 100644 --- a/shell/plugins/bar/widgets/audioPanel.qml +++ b/shell/plugins/bar/widgets/audioPanel.qml @@ -96,8 +96,11 @@ Item { property string focusSection: "output" property int selectedIndex: -1 - readonly property color activeFill: bar - ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.12) + readonly property color hoverFill: bar + ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.08) + : "transparent" + readonly property color selectedFill: bar + ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.18) : "transparent" function sectionCount(section) { @@ -692,7 +695,8 @@ Item { onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(sinkRow) current: isActive foreground: root.bar.foreground - fill: root.activeFill + fill: root.hoverFill + currentFill: root.selectedFill implicitHeight: sinkInner.implicitHeight + 10 Row { @@ -758,7 +762,8 @@ Item { onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(sourceRow) current: isActive foreground: root.bar.foreground - fill: root.activeFill + fill: root.hoverFill + currentFill: root.selectedFill implicitHeight: sourceInner.implicitHeight + 10 Row { @@ -828,7 +833,8 @@ Item { hasCursor: root.focusSection === "streams" && root.selectedIndex === rowIndex onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(streamRow) foreground: root.bar.foreground - fill: root.activeFill + fill: root.hoverFill + currentFill: root.selectedFill implicitHeight: streamColumn.implicitHeight + 8 Column { diff --git a/shell/plugins/bar/widgets/bluetoothPanel.qml b/shell/plugins/bar/widgets/bluetoothPanel.qml index 6d652884..51986fae 100644 --- a/shell/plugins/bar/widgets/bluetoothPanel.qml +++ b/shell/plugins/bar/widgets/bluetoothPanel.qml @@ -108,8 +108,11 @@ Item { // same device across reorders rather than the slot it used to occupy. property string focusedKnownAddress: "" - readonly property color activeFill: bar - ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.12) + readonly property color hoverFill: bar + ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.08) + : "transparent" + readonly property color selectedFill: bar + ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.18) : "transparent" function sectionCount(section) { @@ -557,8 +560,8 @@ Item { onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(row) current: isConnected foreground: root.bar.foreground - fill: root.activeFill - currentFill: root.activeFill + fill: root.hoverFill + currentFill: root.selectedFill // 0 idle, 1 connecting, 2 disconnecting, 3 pairing, 4 failed. property int pendingAction: 0 diff --git a/shell/plugins/bar/widgets/monitorPanel.qml b/shell/plugins/bar/widgets/monitorPanel.qml index 3feb196c..851dad98 100644 --- a/shell/plugins/bar/widgets/monitorPanel.qml +++ b/shell/plugins/bar/widgets/monitorPanel.qml @@ -498,20 +498,22 @@ Item { Repeater { model: root.scaleValues - ChoiceButton { + CursorPill { required property string modelData required property int index width: (panelColumn.width - 30) / 6 text: modelData + "x" foreground: root.bar.foreground - background: root.bar.background - accent: root.bar.foreground + background: "transparent" + tooltipBackground: root.bar.background + tooltipForeground: root.bar.foreground fontFamily: root.bar.fontFamily fontSize: 11 - selected: root.normalizeScale(root.monitorScale) === root.normalizeScale(modelData) + horizontalPadding: 0 + verticalPadding: 6 + active: root.normalizeScale(root.monitorScale) === root.normalizeScale(modelData) hasCursor: root.focusSection === "scale" && root.selectedIndex === index - borderlessHighlight: true onClicked: root.setScale(modelData) onHovered: function(h) { if (h) { diff --git a/shell/plugins/bar/widgets/networkPanel.qml b/shell/plugins/bar/widgets/networkPanel.qml index 32354dfb..3c3a9762 100644 --- a/shell/plugins/bar/widgets/networkPanel.qml +++ b/shell/plugins/bar/widgets/networkPanel.qml @@ -68,7 +68,8 @@ Item { // Mouse hover and keyboard nav both mutate this state at the root; items // never read containsMouse for visuals. See CursorSurface for the // shared chrome (fill / border) shared by NetworkRow and DnsProviderPill. - readonly property color activeFill: bar ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.12) : "transparent" + readonly property color hoverFill: bar ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.08) : "transparent" + readonly property color selectedFill: bar ? Qt.rgba(bar.foreground.r, bar.foreground.g, bar.foreground.b, 0.18) : "transparent" // The panel below is its own layer-shell with Exclusive keyboard focus, // so Hyprland grants focus when the surface is mapped (popupOpen flips @@ -577,7 +578,6 @@ iwctl station "$station" get-networks rssi-dbms 2>/dev/null \\ text: root.icon horizontalMargin: 8.5 rightExtraMargin: 2 - tooltipText: root.networkTooltip() onPressed: function(b) { if (b === Qt.RightButton) root.launchImpala() @@ -956,7 +956,8 @@ iwctl station "$station" get-networks rssi-dbms 2>/dev/null \\ hasCursor: isSelected current: isConnected foreground: root.bar.foreground - fill: root.activeFill + fill: root.hoverFill + currentFill: root.selectedFill // Gate on the matching *Kind/*Reason being non-empty so a hidden-SSID // row (ssid == "") doesn't match the "" defaults of actionSsid etc. readonly property bool isBusy: root.actionKind !== "" && root.actionSsid === (net ? net.ssid : "")