mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-04 11:16:03 +00:00
NPanel: reverted yesterday fix, trying another fix.
This commit is contained in:
+2
-1
@@ -81,7 +81,8 @@ Variants {
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: function (mouse) {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
controlCenterPanel.toggle(BarService.lookupWidget("ControlCenter"))
|
||||
// Important to pass the screen here so we get the right widget for the actual bar that was clicked.
|
||||
controlCenterPanel.toggle(BarService.lookupWidget("ControlCenter", screen.name))
|
||||
mouse.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
+3
-13
@@ -84,22 +84,12 @@ Loader {
|
||||
|
||||
// -----------------------------------------
|
||||
function open(buttonItem) {
|
||||
|
||||
// Get the button position if provided
|
||||
if (buttonItem !== undefined && buttonItem !== null) {
|
||||
useButtonPosition = true
|
||||
// Try to get the button's window
|
||||
var buttonWindow = buttonItem.Window.window
|
||||
if (buttonWindow) {
|
||||
// Map to button's window coordinates
|
||||
var itemPosInWindow = buttonItem.mapToItem(buttonWindow.contentItem, 0, 0)
|
||||
// Then account for window position on screen
|
||||
buttonPosition = Qt.point(buttonWindow.x + itemPosInWindow.x, buttonWindow.y + itemPosInWindow.y)
|
||||
} else {
|
||||
// Fallback to old method
|
||||
var itemPos = buttonItem.mapToItem(null, 0, 0)
|
||||
buttonPosition = Qt.point(itemPos.x, itemPos.y)
|
||||
Logger.warn("NPanel", "Falling back to mapToItem null")
|
||||
}
|
||||
var itemPos = buttonItem.mapToItem(null, 0, 0)
|
||||
buttonPosition = Qt.point(itemPos.x, itemPos.y)
|
||||
buttonWidth = buttonItem.width
|
||||
buttonHeight = buttonItem.height
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user