control-center: added a new option to disable the right click open at cursor pos.

This commit is contained in:
Lemmy
2026-03-01 17:31:14 -05:00
parent fcd08289ad
commit 1c3760b73b
22 changed files with 59 additions and 8 deletions
+6 -8
View File
@@ -343,15 +343,13 @@ Item {
if (mouse.button === Qt.RightButton) {
if (bar.isPointOverWidget(mouse.x, mouse.y))
return;
// Click is on empty bar background - open control center
var controlCenterPanel = PanelService.getPanel("controlCenterPanel", screen);
// Map click position to screen-relative coordinates
// We need to map from bar coordinates to screen coordinates
var screenRelativePos = mapToItem(null, mouse.x, mouse.y);
// Pass click position directly
controlCenterPanel?.toggle(null, screenRelativePos);
if (Settings.data.controlCenter.openAtMouseOnBarRightClick) {
var screenRelativePos = mapToItem(null, mouse.x, mouse.y);
controlCenterPanel?.toggle(null, screenRelativePos);
} else {
controlCenterPanel?.toggle();
}
mouse.accepted = true;
}
}