From 82506ae7cd9a913115853aa0c6436bb2315d614d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 23 Jul 2025 09:00:54 +0700 Subject: [PATCH] groupbutton: press and hold for alt action --- .../ii/modules/common/widgets/GroupButton.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/common/widgets/GroupButton.qml b/.config/quickshell/ii/modules/common/widgets/GroupButton.qml index a64cd0630..4a524e1d5 100644 --- a/.config/quickshell/ii/modules/common/widgets/GroupButton.qml +++ b/.config/quickshell/ii/modules/common/widgets/GroupButton.qml @@ -93,13 +93,23 @@ Button { root.down = false if (event.button != Qt.LeftButton) return; if (root.releaseAction) root.releaseAction(); - root.click() // Because the MouseArea already consumed the event + } + onClicked: (event) => { + if (event.button != Qt.LeftButton) return; + root.click() } onCanceled: (event) => { root.down = false } + + onPressAndHold: () => { + altAction(); + root.down = false; + root.clicked = false; + }; } + background: Rectangle { id: buttonBackground topLeftRadius: root.leftRadius