More tweaking and standardization

This commit is contained in:
David Heinemeier Hansson
2026-05-18 15:54:14 +02:00
parent acf617e05e
commit f3ba505558
9 changed files with 41 additions and 29 deletions
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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))
+2 -2
View File
@@ -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")
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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 } }
+11 -5
View File
@@ -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 {
+7 -4
View File
@@ -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
+7 -5
View File
@@ -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) {
+4 -3
View File
@@ -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 : "")