refactor: unified BarModule base component, click-to-open panels, remove pinning
This commit is contained in:
parent
034f0b6d85
commit
26476dc930
33 changed files with 273 additions and 517 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue