From 5acd9d6fa93f836be88b1c75fef81d9251646e98 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 19 Sep 2026 10:08:01 +0200 Subject: 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. --- desktop/Button.qml | 7 +++++-- desktop/modules/sound/TransportButton.qml | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'desktop') 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 { -- cgit v1.2.3