refactor: unified BarModule base component, click-to-open panels, remove pinning

This commit is contained in:
Damocles 2026-04-25 11:52:20 +02:00
parent 034f0b6d85
commit 26476dc930
33 changed files with 273 additions and 517 deletions

View file

@ -4,10 +4,18 @@ import "." as M
import "../services" as S
import "../applets" as C
M.PinnableSection {
M.BarModule {
id: root
spacing: S.Theme.moduleSpacing
_panelHovered: hoverPanel.panelHovered
tooltip: {
if (state === "wifi")
return "Wi-Fi: " + S.NetworkService.essid;
if (state === "eth")
return "Ethernet: connected";
if (state === "linked")
return "Network: linked";
return "Network: disconnected";
}
readonly property string state: S.NetworkService.state
@ -23,18 +31,12 @@ M.PinnableSection {
}
color: root.state === "disconnected" ? S.Theme.base08 : root.accentColor
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
}
}
M.BarLabel {
visible: root.state === "wifi"
label: S.NetworkService.essid
color: root.state === "disconnected" ? S.Theme.base08 : root.accentColor
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
}
}
Connections {
@ -53,6 +55,7 @@ M.PinnableSection {
panelNamespace: "nova-network"
panelTitle: "Wi-Fi"
contentWidth: 250
onDismissed: root.dismissPanel()
titleActionsComponent: Component {
Item {
width: 20