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: "Disk: " + _rootPct + "% used"
|
||||
|
||||
property var _mounts: S.SystemStats.diskMounts
|
||||
property int _rootPct: S.SystemStats.diskRootPct
|
||||
|
|
@ -23,18 +23,12 @@ M.PinnableSection {
|
|||
icon: "\uF0C9"
|
||||
color: root._anyWarn ? S.Theme.base09 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
TapHandler {
|
||||
onTapped: root._pinned = !root._pinned
|
||||
}
|
||||
}
|
||||
M.BarLabel {
|
||||
label: root._rootPct + "%"
|
||||
minText: "100%"
|
||||
color: root._anyWarn ? S.Theme.base09 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
TapHandler {
|
||||
onTapped: root._pinned = !root._pinned
|
||||
}
|
||||
}
|
||||
|
||||
M.HoverPanel {
|
||||
|
|
@ -46,6 +40,7 @@ M.PinnableSection {
|
|||
panelNamespace: "nova-disk"
|
||||
panelTitle: "Disk"
|
||||
contentWidth: 260
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
C.DiskApplet {
|
||||
width: hoverPanel.contentWidth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue