nova-shell/modules/Wlogout.qml
2026-04-12 15:47:14 +02:00

36 lines
795 B
QML

import QtQuick
import Quickshell
import "." as M
M.BarIcon {
id: root
icon: "\uF011"
color: M.Theme.base08
tooltip: "Power menu"
required property var bar
Process {
id: runner
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: menuLoader.active = !menuLoader.active
}
Loader {
id: menuLoader
active: false
sourceComponent: M.PowerMenu {
screen: root.bar.screen
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
onMenuClosed: menuLoader.active = false
onRunCommand: cmd => {
runner.command = cmd;
runner.running = true;
}
}
}
}