aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-19 10:08:01 +0200
committerDanilo M. <danix@danix.xyz>2026-09-19 10:08:01 +0200
commit5acd9d6fa93f836be88b1c75fef81d9251646e98 (patch)
treea5e7aae81744f2c1a47f1179992fe34e3a8fa41b
parentb4be7d036bbe19339c3c8ab66a06ce6f0f9e9db9 (diff)
downloadquickshell-5acd9d6fa93f836be88b1c75fef81d9251646e98.tar.gz
quickshell-5acd9d6fa93f836be88b1c75fef81d9251646e98.zip
feat(desktop): press feedback on the shared buttons
The hand-rolled buttons only reacted to hover, so a press gave no visual confirmation until the action's outcome appeared. kdeconnect made this obvious: its row buttons shell out to kdeconnect-cli, and nothing on screen acknowledged the click. Button.qml now fills solid accent while the mouse is held (red for danger), with the label flipped to base for contrast. TransportButton gets the same treatment, and the window-switcher close button lightens on press. Toggles, tiles and tabs are left alone: their own state change is already the feedback.
-rw-r--r--desktop/Button.qml7
-rw-r--r--desktop/modules/sound/TransportButton.qml6
-rw-r--r--window-switcher/WindowCard.qml5
3 files changed, 13 insertions, 5 deletions
diff --git a/desktop/Button.qml b/desktop/Button.qml
index d6ca78f..3e0d63f 100644
--- a/desktop/Button.qml
+++ b/desktop/Button.qml
@@ -22,7 +22,9 @@ Rectangle {
implicitHeight: label.implicitHeight + 12
radius: 7
opacity: enabled ? 1 : 0.4
- color: area.containsMouse && enabled
+ color: area.pressed && enabled
+ ? (danger ? Theme.red : Theme.accent)
+ : area.containsMouse && enabled
? Qt.alpha(danger ? Theme.red : Theme.accent, 0.25)
: Qt.alpha(Theme.surface, 0.8)
border.width: 1
@@ -32,7 +34,8 @@ Rectangle {
id: label
anchors.centerIn: parent
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 }
- color: danger ? Theme.red : Theme.text
+ color: (area.pressed && btn.enabled) ? Theme.base
+ : danger ? Theme.red : Theme.text
}
MouseArea {
diff --git a/desktop/modules/sound/TransportButton.qml b/desktop/modules/sound/TransportButton.qml
index b6dd53f..f7f72fa 100644
--- a/desktop/modules/sound/TransportButton.qml
+++ b/desktop/modules/sound/TransportButton.qml
@@ -19,14 +19,16 @@ Rectangle {
signal clicked
width: 30; height: 30; radius: 15
- color: area.containsMouse && enabled ? Qt.alpha(Theme.accent, 0.22) : "transparent"
+ color: area.pressed && enabled
+ ? Theme.accent
+ : area.containsMouse && enabled ? Qt.alpha(Theme.accent, 0.22) : "transparent"
opacity: enabled ? 1 : 0.35
Text {
anchors.centerIn: parent
text: btn.glyph
font { family: Theme.iconFamily; pixelSize: 14 }
- color: Theme.text
+ color: (area.pressed && btn.enabled) ? Theme.base : Theme.text
}
MouseArea {
diff --git a/window-switcher/WindowCard.qml b/window-switcher/WindowCard.qml
index b86d69d..b671f0f 100644
--- a/window-switcher/WindowCard.qml
+++ b/window-switcher/WindowCard.qml
@@ -94,7 +94,9 @@ Column {
id: closeButton
anchors { right: parent.right; top: parent.top; margins: 8 }
width: 34; height: 34; radius: 17
- color: closeHover.hovered
+ color: closeArea.pressed
+ ? Qt.lighter(Theme.red, 1.25)
+ : closeHover.hovered
? Theme.red
: Qt.rgba(Theme.base.r, Theme.base.g, Theme.base.b, 0.75)
@@ -107,6 +109,7 @@ Column {
HoverHandler { id: closeHover }
MouseArea {
+ id: closeArea
anchors.fill: parent
onClicked: card.closeRequested()
}