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
|
|
@ -10,6 +10,16 @@ M.BarModule {
|
|||
opacity: S.Modules.battery.enable && S.BatteryService.available ? 1 : 0
|
||||
visible: opacity > 0
|
||||
tooltip: "Battery: " + Math.round(S.BatteryService.percent) + "%" + (S.BatteryService.charging ? " (charging)" : "")
|
||||
panelNamespace: "nova-battery"
|
||||
panelTitle: "Battery"
|
||||
panelContentWidth: 240
|
||||
panelComponent: Component {
|
||||
C.BatteryApplet {
|
||||
width: parent.width
|
||||
active: root._showPanel
|
||||
accentColor: root.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
property real _blinkOpacity: 1
|
||||
|
||||
|
|
@ -37,22 +47,4 @@ M.BarModule {
|
|||
opacity: root._blinkOpacity
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
M.HoverPanel {
|
||||
id: hoverPanel
|
||||
showPanel: root._showPanel
|
||||
screen: QsWindow.window?.screen ?? null
|
||||
anchorItem: root
|
||||
accentColor: root.accentColor
|
||||
panelNamespace: "nova-battery"
|
||||
panelTitle: "Battery"
|
||||
contentWidth: 240
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
C.BatteryApplet {
|
||||
width: hoverPanel.contentWidth
|
||||
active: root._showPanel
|
||||
accentColor: root.accentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue