ControlCenter: fix/improve opening position

This commit is contained in:
ItsLemmy
2025-11-07 10:47:28 -05:00
parent 03425f4260
commit 19463f4395
4 changed files with 42 additions and 28 deletions
+7 -5
View File
@@ -178,11 +178,13 @@ Item {
preventStealing: true
onClicked: function (mouse) {
if (mouse.button === Qt.RightButton) {
// Look up for any ControlCenter button on this bar
var widget = BarService.lookupWidget("ControlCenter", root.screen.name)
// Open the panel near the button if any
PanelService.getPanel("controlCenterPanel", root.screen)?.toggle(widget)
var controlCenterPanel = PanelService.getPanel("controlCenterPanel", screen)
if (Settings.data.controlCenter.position === "close_to_bar_button") {
// Will attempt to open the panel next to the bar button if any.
controlCenterPanel?.toggle(null, "ControlCenter")
} else {
controlCenterPanel?.toggle()
}
mouse.accepted = true
}
}