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,20 @@ import "../applets" as C
|
|||
M.BarModule {
|
||||
id: root
|
||||
tooltip: "Power menu"
|
||||
panelNamespace: "nova-power"
|
||||
panelTitle: "Power"
|
||||
panelContentWidth: 180
|
||||
panelComponent: Component {
|
||||
C.PowerApplet {
|
||||
width: parent.width
|
||||
accentColor: root.accentColor
|
||||
onRunCommand: cmd => {
|
||||
runner.command = cmd;
|
||||
runner.running = true;
|
||||
}
|
||||
onDismiss: root.dismissPanel()
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: runner
|
||||
|
|
@ -17,26 +31,4 @@ M.BarModule {
|
|||
icon: "\uF011"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
M.HoverPanel {
|
||||
id: hoverPanel
|
||||
showPanel: root._showPanel
|
||||
screen: QsWindow.window?.screen ?? null
|
||||
anchorItem: root
|
||||
accentColor: root.accentColor
|
||||
panelNamespace: "nova-power"
|
||||
panelTitle: "Power"
|
||||
contentWidth: 180
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
C.PowerApplet {
|
||||
width: hoverPanel.contentWidth
|
||||
accentColor: root.accentColor
|
||||
onRunCommand: cmd => {
|
||||
runner.command = cmd;
|
||||
runner.running = true;
|
||||
}
|
||||
onDismiss: root.dismissPanel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue