From 84e89599bf23d3148392c21ad7629c57a8c3ab45 Mon Sep 17 00:00:00 2001 From: bbedward Date: Sat, 1 Nov 2025 10:39:25 -0400 Subject: [PATCH] widgets: fix right click handling --- Modules/DankBar/Widgets/LauncherButton.qml | 16 +++++----------- Modules/Plugins/BasePill.qml | 9 +++++++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Modules/DankBar/Widgets/LauncherButton.qml b/Modules/DankBar/Widgets/LauncherButton.qml index a302a8fb..1880f7e0 100644 --- a/Modules/DankBar/Widgets/LauncherButton.qml +++ b/Modules/DankBar/Widgets/LauncherButton.qml @@ -108,17 +108,11 @@ BasePill { } } - MouseArea { - id: customMouseArea - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.RightButton - onPressed: function (mouse){ - if (CompositorService.isNiri) { - NiriService.toggleOverview() - } else if (root.hyprlandOverviewLoader?.item) { - root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen - } + onRightClicked: { + if (CompositorService.isNiri) { + NiriService.toggleOverview() + } else if (root.hyprlandOverviewLoader?.item) { + root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen } } } diff --git a/Modules/Plugins/BasePill.qml b/Modules/Plugins/BasePill.qml index 7c5eda3a..0bc713ca 100644 --- a/Modules/Plugins/BasePill.qml +++ b/Modules/Plugins/BasePill.qml @@ -33,6 +33,7 @@ Item { readonly property real bottomMargin: isVerticalOrientation ? (isBottomBarEdge && isLast ? barEdgeExtension : (isLast ? gapExtension : gapExtension / 2)) : 0 signal clicked() + signal rightClicked() width: isVerticalOrientation ? barThickness : visualWidth height: isVerticalOrientation ? visualHeight : barThickness @@ -69,8 +70,12 @@ Item { height: root.height + root.topMargin + root.bottomMargin hoverEnabled: true cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.LeftButton - onPressed: { + acceptedButtons: Qt.LeftButton | Qt.RightButton + onPressed: function (mouse) { + if (mouse.button === Qt.RightButton) { + root.rightClicked() + return + } if (popoutTarget && popoutTarget.setTriggerPosition) { const globalPos = root.visualContent.mapToGlobal(0, 0) const currentScreen = parentScreen || Screen