barmodule: own hoverpanel internally, modules supply content as component
This commit is contained in:
parent
26476dc930
commit
6fd36c812f
17 changed files with 367 additions and 453 deletions
|
|
@ -8,6 +8,16 @@ M.BarModule {
|
|||
id: root
|
||||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
tooltip: "Disk: " + _rootPct + "% used"
|
||||
panelNamespace: "nova-disk"
|
||||
panelTitle: "Disk"
|
||||
panelContentWidth: 260
|
||||
panelComponent: Component {
|
||||
C.DiskApplet {
|
||||
width: parent.width
|
||||
mounts: root._mounts
|
||||
accentColor: root.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
property var _mounts: S.SystemStats.diskMounts
|
||||
property int _rootPct: S.SystemStats.diskRootPct
|
||||
|
|
@ -30,22 +40,4 @@ M.BarModule {
|
|||
color: root._anyWarn ? S.Theme.base09 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
M.HoverPanel {
|
||||
id: hoverPanel
|
||||
showPanel: root._showPanel
|
||||
screen: QsWindow.window?.screen ?? null
|
||||
anchorItem: root
|
||||
accentColor: root.accentColor
|
||||
panelNamespace: "nova-disk"
|
||||
panelTitle: "Disk"
|
||||
contentWidth: 260
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
C.DiskApplet {
|
||||
width: hoverPanel.contentWidth
|
||||
mounts: root._mounts
|
||||
accentColor: root.accentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue