hoverpanel: fix pin icons, hide pin during osd, convert network to hover panel

This commit is contained in:
Damocles 2026-04-15 23:09:30 +02:00
parent dca6a8ac5c
commit 54f80f0da8
4 changed files with 16 additions and 41 deletions

View file

@ -6,25 +6,7 @@ import "." as M
M.BarSection {
id: root
spacing: M.Theme.moduleSpacing
tooltip: {
const parts = [];
if (root.state === "wifi") {
parts.push("WiFi: " + root.essid);
if (root.signal)
parts.push("Signal: " + root.signal + "%");
} else if (root.state === "eth") {
parts.push("Ethernet");
} else if (root.state === "linked") {
parts.push("Linked");
} else {
return "Disconnected";
}
if (root.ipAddr)
parts.push("IP: " + root.ipAddr);
if (root.ifname)
parts.push("Interface: " + root.ifname);
return parts.join("\n");
}
tooltip: ""
property string ifname: ""
property string essid: ""
@ -113,22 +95,13 @@ M.BarSection {
required property var bar
TapHandler {
cursorShape: Qt.PointingHandCursor
onTapped: {
menuLoader.active = !menuLoader.active;
M.FlyoutState.visible = false;
}
}
readonly property bool _anyHover: root._hovered || networkMenu.panelHovered
LazyLoader {
id: menuLoader
active: false
M.NetworkMenu {
accentColor: root.accentColor
screen: root.bar.screen
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
onDismissed: menuLoader.active = false
}
M.NetworkMenu {
id: networkMenu
showPanel: root._anyHover
screen: root.bar.screen
anchorItem: root
accentColor: root.accentColor
}
}