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,26 +4,20 @@ import "." as M
import "../services" as S
import "../applets" as C
M.PinnableSection {
M.BarModule {
id: root
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
visible: S.Modules.gpu.enable && S.SystemStats.gpuAvailable
_panelHovered: hoverPanel.panelHovered
tooltip: "GPU: " + S.SystemStats.gpuUsage + "%"
M.BarIcon {
icon: "\uEB4C"
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
}
}
M.BarLabel {
label: S.SystemStats.gpuUsage + "%"
minText: "100%"
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
}
}
M.HoverPanel {
@ -35,6 +29,7 @@ M.PinnableSection {
panelNamespace: "nova-gpu"
panelTitle: "GPU"
contentWidth: 240
onDismissed: root.dismissPanel()
C.GpuApplet {
width: hoverPanel.contentWidth