fix flyouts on multiple monitors, update mds

This commit is contained in:
Damocles 2026-04-12 15:30:35 +02:00
parent ab2eb2578e
commit 75a94628ad
7 changed files with 36 additions and 11 deletions

View file

@ -1,4 +1,5 @@
import QtQuick
import Quickshell
import "." as M
Text {
@ -17,6 +18,7 @@ Text {
if (hovered && root.tooltip !== "") {
M.FlyoutState.text = root.tooltip;
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 !== "") {
M.FlyoutState.visible = false;

View file

@ -1,4 +1,5 @@
import QtQuick
import Quickshell
import "." as M
Text {
@ -17,6 +18,7 @@ Text {
if (hovered && root.tooltip !== "") {
M.FlyoutState.text = root.tooltip;
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 !== "") {
M.FlyoutState.visible = false;

View file

@ -1,4 +1,5 @@
import QtQuick
import Quickshell
import "." as M
Row {
@ -10,6 +11,7 @@ Row {
if (hovered && root.tooltip !== "") {
M.FlyoutState.text = root.tooltip;
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 !== "") {
M.FlyoutState.visible = false;

View file

@ -8,7 +8,7 @@ PanelWindow {
required property var screen
visible: M.FlyoutState.visible
visible: M.FlyoutState.visible && M.FlyoutState.screen === root.screen
color: "transparent"
WlrLayershell.layer: WlrLayer.Overlay

View file

@ -5,4 +5,5 @@ QtObject {
property bool visible: false
property string text: ""
property real itemX: 0
property var screen: null
}

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.SystemTray
import "." as M
RowLayout {
@ -34,6 +35,7 @@ RowLayout {
if (hovered && tip) {
M.FlyoutState.text = tip;
M.FlyoutState.itemX = iconItem.mapToGlobal(iconItem.width / 2, 0).x;
M.FlyoutState.screen = QsWindow.window?.screen ?? null;
M.FlyoutState.visible = true;
} else if (!hovered) {
M.FlyoutState.visible = false;