refactor: unified BarModule base component, click-to-open panels, remove pinning

This commit is contained in:
Damocles 2026-04-25 11:52:20 +02:00
parent 034f0b6d85
commit 26476dc930
33 changed files with 273 additions and 517 deletions

View file

@ -3,39 +3,40 @@ import Quickshell
import Quickshell.Io
import "." as M
import "../services" as S
import "../applets" as C
M.BarIcon {
M.BarModule {
id: root
icon: "\uF011"
tooltip: "Power menu"
required property var bar
Process {
id: runner
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
menuLoader.active = !menuLoader.active;
M.TooltipState.visible = false;
}
M.BarIcon {
icon: "\uF011"
anchors.verticalCenter: parent.verticalCenter
}
LazyLoader {
id: menuLoader
active: false
M.PowerMenu {
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
screen: root.bar.screen
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
onDismissed: menuLoader.active = false
onRunCommand: cmd => {
runner.command = cmd;
runner.running = true;
}
onDismiss: root.dismissPanel()
}
}
}