mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-26 22:42: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:
committed by
GitHub
parent
caa085a646
commit
5fa117db4c
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user