diff --git a/modules/BarIcon.qml b/modules/BarIcon.qml index e0033a9..371dd6a 100644 --- a/modules/BarIcon.qml +++ b/modules/BarIcon.qml @@ -17,7 +17,7 @@ Text { onHoveredChanged: { if (hovered && root.tooltip !== "") { M.FlyoutState.text = root.tooltip; - M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0); + M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x; M.FlyoutState.screen = QsWindow.window?.screen ?? null; M.FlyoutState.visible = true; } else if (!hovered && root.tooltip !== "") { diff --git a/modules/BarLabel.qml b/modules/BarLabel.qml index f5cff64..cdf416f 100644 --- a/modules/BarLabel.qml +++ b/modules/BarLabel.qml @@ -17,7 +17,7 @@ Text { onHoveredChanged: { if (hovered && root.tooltip !== "") { M.FlyoutState.text = root.tooltip; - M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0); + M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x; M.FlyoutState.screen = QsWindow.window?.screen ?? null; M.FlyoutState.visible = true; } else if (!hovered && root.tooltip !== "") { diff --git a/modules/BarSection.qml b/modules/BarSection.qml index 0602fb4..f248b80 100644 --- a/modules/BarSection.qml +++ b/modules/BarSection.qml @@ -10,7 +10,7 @@ Row { onHoveredChanged: { if (hovered && root.tooltip !== "") { M.FlyoutState.text = root.tooltip; - M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0); + M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x; M.FlyoutState.screen = QsWindow.window?.screen ?? null; M.FlyoutState.visible = true; } else if (!hovered && root.tooltip !== "") { diff --git a/modules/PowerMenu.qml b/modules/PowerMenu.qml index 5c6f38f..c0eb08a 100644 --- a/modules/PowerMenu.qml +++ b/modules/PowerMenu.qml @@ -14,16 +14,6 @@ PanelWindow { readonly property bool _isNiri: Quickshell.env("NIRI_SOCKET") !== "" - Process { - id: runner - } - - function _run(cmd) { - runner.command = cmd; - runner.running = true; - menuClosed(); - } - visible: true color: "transparent" @@ -122,11 +112,19 @@ PanelWindow { font.family: M.Theme.fontFamily } + Process { + id: runner + command: entry.modelData.cmd + } + MouseArea { id: entryArea anchors.fill: parent hoverEnabled: true - onClicked: menuWindow._run(entry.modelData.cmd) + onClicked: { + runner.running = true; + menuWindow.menuClosed(); + } } } } diff --git a/modules/PowerProfile.qml b/modules/PowerProfile.qml index 236437a..904492f 100644 --- a/modules/PowerProfile.qml +++ b/modules/PowerProfile.qml @@ -51,9 +51,7 @@ M.BarIcon { onClicked: { const cycle = ["performance", "balanced", "power-saver"]; const idx = cycle.indexOf(root.profile); - const next = cycle[(idx + 1) % cycle.length]; - root.profile = next; - setter.next = next; + setter.next = cycle[(idx + 1) % cycle.length]; setter.running = true; } } diff --git a/modules/Tray.qml b/modules/Tray.qml index 2474a3f..abe87f2 100644 --- a/modules/Tray.qml +++ b/modules/Tray.qml @@ -34,7 +34,7 @@ RowLayout { .filter(s => s).join("\n") || iconItem.modelData.title; if (hovered && tip) { M.FlyoutState.text = tip; - M.FlyoutState.itemX = iconItem.mapToGlobal(iconItem.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0); + M.FlyoutState.itemX = iconItem.mapToGlobal(iconItem.width / 2, 0).x; M.FlyoutState.screen = QsWindow.window?.screen ?? null; M.FlyoutState.visible = true; } else if (!hovered) { @@ -69,7 +69,7 @@ RowLayout { sourceComponent: M.TrayMenu { handle: iconItem.modelData.menu screen: root.bar.screen - anchorX: iconItem.mapToGlobal(iconItem.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) + anchorX: iconItem.mapToGlobal(iconItem.width / 2, 0).x onMenuClosed: { menuLoader.active = false; root._activeMenu = null; diff --git a/modules/Wlogout.qml b/modules/Wlogout.qml index 2f4e9ed..640b024 100644 --- a/modules/Wlogout.qml +++ b/modules/Wlogout.qml @@ -20,7 +20,7 @@ M.BarIcon { active: false sourceComponent: M.PowerMenu { screen: root.bar.screen - anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) + anchorX: root.mapToGlobal(root.width / 2, 0).x onMenuClosed: menuLoader.active = false } }