barmodule: own hoverpanel internally, modules supply content as component

This commit is contained in:
Damocles 2026-04-25 14:07:26 +02:00
parent 26476dc930
commit 6fd36c812f
17 changed files with 367 additions and 453 deletions

View file

@ -9,6 +9,16 @@ M.BarModule {
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
visible: S.Modules.gpu.enable && S.SystemStats.gpuAvailable
tooltip: "GPU: " + S.SystemStats.gpuUsage + "%"
panelNamespace: "nova-gpu"
panelTitle: "GPU"
panelContentWidth: 240
panelComponent: Component {
C.GpuApplet {
width: parent.width
active: root._showPanel
accentColor: root.accentColor
}
}
M.BarIcon {
icon: "\uEB4C"
@ -19,22 +29,4 @@ M.BarModule {
minText: "100%"
anchors.verticalCenter: parent.verticalCenter
}
M.HoverPanel {
id: hoverPanel
showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null
anchorItem: root
accentColor: root.accentColor
panelNamespace: "nova-gpu"
panelTitle: "GPU"
contentWidth: 240
onDismissed: root.dismissPanel()
C.GpuApplet {
width: hoverPanel.contentWidth
active: root._showPanel
accentColor: root.accentColor
}
}
}