diff --git a/modules/BarIcon.qml b/modules/BarIcon.qml index 87c8204..0b07239 100644 --- a/modules/BarIcon.qml +++ b/modules/BarIcon.qml @@ -1,5 +1,4 @@ import QtQuick -import Quickshell import "." as M Text { @@ -16,10 +15,8 @@ Text { HoverHandler { onHoveredChanged: { if (hovered && root.tooltip !== "") { - const win = QsWindow.window M.FlyoutState.text = root.tooltip - M.FlyoutState.itemX = root.mapToItem(win, root.width / 2, 0).x - M.FlyoutState.screen = win?.screen ?? null + M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x M.FlyoutState.visible = true } else if (!hovered && root.tooltip !== "") { M.FlyoutState.visible = false diff --git a/modules/BarLabel.qml b/modules/BarLabel.qml index 4d9d202..8baad19 100644 --- a/modules/BarLabel.qml +++ b/modules/BarLabel.qml @@ -1,5 +1,4 @@ import QtQuick -import Quickshell import "." as M Text { @@ -16,10 +15,8 @@ Text { HoverHandler { onHoveredChanged: { if (hovered && root.tooltip !== "") { - const win = QsWindow.window M.FlyoutState.text = root.tooltip - M.FlyoutState.itemX = root.mapToItem(win, root.width / 2, 0).x - M.FlyoutState.screen = win?.screen ?? null + M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x M.FlyoutState.visible = true } else if (!hovered && root.tooltip !== "") { M.FlyoutState.visible = false diff --git a/modules/BarSection.qml b/modules/BarSection.qml index 071660e..a7d44e6 100644 --- a/modules/BarSection.qml +++ b/modules/BarSection.qml @@ -1,5 +1,4 @@ import QtQuick -import Quickshell import "." as M Row { @@ -9,10 +8,8 @@ Row { HoverHandler { onHoveredChanged: { if (hovered && root.tooltip !== "") { - const win = QsWindow.window M.FlyoutState.text = root.tooltip - M.FlyoutState.itemX = root.mapToItem(win, root.width / 2, 0).x - M.FlyoutState.screen = win?.screen ?? null + M.FlyoutState.itemX = root.mapToGlobal(root.width / 2, 0).x M.FlyoutState.visible = true } else if (!hovered && root.tooltip !== "") { M.FlyoutState.visible = false diff --git a/modules/Flyout.qml b/modules/Flyout.qml index 1a8c79e..b342cd5 100644 --- a/modules/Flyout.qml +++ b/modules/Flyout.qml @@ -8,7 +8,7 @@ PanelWindow { required property var screen - visible: M.FlyoutState.visible && M.FlyoutState.screen === screen + visible: M.FlyoutState.visible color: "transparent" WlrLayershell.layer: WlrLayer.Overlay diff --git a/modules/FlyoutState.qml b/modules/FlyoutState.qml index e2e51b3..489001e 100644 --- a/modules/FlyoutState.qml +++ b/modules/FlyoutState.qml @@ -5,5 +5,4 @@ QtObject { property bool visible: false property string text: "" property real itemX: 0 - property var screen: null } diff --git a/modules/PowerProfile.qml b/modules/PowerProfile.qml index e3c0bb0..09240f5 100644 --- a/modules/PowerProfile.qml +++ b/modules/PowerProfile.qml @@ -37,8 +37,10 @@ M.BarIcon { onRunningChanged: if (!running && next !== "") proc.running = true } - TapHandler { - onTapped: { + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: { const cycle = ["performance", "balanced", "power-saver"]; const idx = cycle.indexOf(root.profile); setter.next = cycle[(idx + 1) % cycle.length];