1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

widgets: fix right click handling

This commit is contained in:
bbedward
2025-11-01 10:39:25 -04:00
parent e1cdf4ed50
commit 84e89599bf
2 changed files with 12 additions and 13 deletions

View File

@@ -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
}
}
}

View File

@@ -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