1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 15:02:50 -05:00

PluginComponent: support for right click not defaulted to poput toggle (#677)

* PluginComponent: support for right click not defaulted to poput toggle

* PluginComponent: right click docs
This commit is contained in:
Massimo Branchini
2025-11-09 18:12:47 +01:00
committed by GitHub
parent caa085a646
commit 5fa117db4c
2 changed files with 35 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ Item {
property real popoutWidth: 400
property real popoutHeight: 0
property var pillClickAction: null
property var pillRightClickAction: null
property Component controlCenterWidget: null
property string ccWidgetIcon: ""
@@ -120,6 +121,18 @@ Item {
pluginPopout.toggle()
}
}
onRightClicked: {
if (pillRightClickAction) {
if (pillRightClickAction.length === 0) {
pillRightClickAction()
} else {
const globalPos = mapToGlobal(0, 0)
const currentScreen = parentScreen || Screen
const pos = SettingsData.getPopupTriggerPosition(globalPos, currentScreen, barThickness, width)
pillRightClickAction(pos.x, pos.y, pos.width, section, currentScreen)
}
}
}
}
BasePill {
@@ -147,6 +160,18 @@ Item {
pluginPopout.toggle()
}
}
onRightClicked: {
if (pillRightClickAction) {
if (pillRightClickAction.length === 0) {
pillRightClickAction()
} else {
const globalPos = mapToGlobal(0, 0)
const currentScreen = parentScreen || Screen
const pos = SettingsData.getPopupTriggerPosition(globalPos, currentScreen, barThickness, width)
pillRightClickAction(pos.x, pos.y, pos.width, section, currentScreen)
}
}
}
}
function closePopout() {