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,10 @@ 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)
_panelHovered: hoverPanel.panelHovered
tooltip: "Memory: " + usedGb.toFixed(1) + " / " + totalGb.toFixed(1) + " GB"
property int percent: S.SystemStats.memPercent
property real usedGb: S.SystemStats.memUsedGb
@ -25,17 +25,11 @@ M.PinnableSection {
M.BarIcon {
icon: "\uEFC5"
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
}
}
M.BarLabel {
label: root.percent + "%"
minText: "100%"
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
}
}
M.HoverPanel {
@ -47,6 +41,7 @@ M.PinnableSection {
panelNamespace: "nova-memory"
panelTitle: "Memory"
contentWidth: 240
onDismissed: root.dismissPanel()
C.MemoryApplet {
width: hoverPanel.contentWidth