rename power
This commit is contained in:
parent
48c58e2fbf
commit
4df704844e
6 changed files with 7 additions and 7 deletions
37
modules/Power.qml
Normal file
37
modules/Power.qml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue