mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 02:02:08 -04:00
widgets: fix right click handling
This commit is contained in:
@@ -108,17 +108,11 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
onRightClicked: {
|
||||||
id: customMouseArea
|
if (CompositorService.isNiri) {
|
||||||
anchors.fill: parent
|
NiriService.toggleOverview()
|
||||||
cursorShape: Qt.PointingHandCursor
|
} else if (root.hyprlandOverviewLoader?.item) {
|
||||||
acceptedButtons: Qt.RightButton
|
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen
|
||||||
onPressed: function (mouse){
|
|
||||||
if (CompositorService.isNiri) {
|
|
||||||
NiriService.toggleOverview()
|
|
||||||
} else if (root.hyprlandOverviewLoader?.item) {
|
|
||||||
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ Item {
|
|||||||
readonly property real bottomMargin: isVerticalOrientation ? (isBottomBarEdge && isLast ? barEdgeExtension : (isLast ? gapExtension : gapExtension / 2)) : 0
|
readonly property real bottomMargin: isVerticalOrientation ? (isBottomBarEdge && isLast ? barEdgeExtension : (isLast ? gapExtension : gapExtension / 2)) : 0
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
signal rightClicked()
|
||||||
|
|
||||||
width: isVerticalOrientation ? barThickness : visualWidth
|
width: isVerticalOrientation ? barThickness : visualWidth
|
||||||
height: isVerticalOrientation ? visualHeight : barThickness
|
height: isVerticalOrientation ? visualHeight : barThickness
|
||||||
@@ -69,8 +70,12 @@ Item {
|
|||||||
height: root.height + root.topMargin + root.bottomMargin
|
height: root.height + root.topMargin + root.bottomMargin
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
onPressed: {
|
onPressed: function (mouse) {
|
||||||
|
if (mouse.button === Qt.RightButton) {
|
||||||
|
root.rightClicked()
|
||||||
|
return
|
||||||
|
}
|
||||||
if (popoutTarget && popoutTarget.setTriggerPosition) {
|
if (popoutTarget && popoutTarget.setTriggerPosition) {
|
||||||
const globalPos = root.visualContent.mapToGlobal(0, 0)
|
const globalPos = root.visualContent.mapToGlobal(0, 0)
|
||||||
const currentScreen = parentScreen || Screen
|
const currentScreen = parentScreen || Screen
|
||||||
|
|||||||
Reference in New Issue
Block a user