refaktor
This commit is contained in:
@@ -1,48 +1,30 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import "../../../colors"
|
||||
import "../../../config"
|
||||
|
||||
MouseArea {
|
||||
id: powerButton
|
||||
width: Math.max(powerText.width + Config.spacing, bar.height)
|
||||
width: Math.max(powerText.width + Config.spacing_fun(height), height)
|
||||
height: bar.height
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
console.log("[PowerButton] Opening wlogout")
|
||||
root.openWlogout()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: powerButton.containsMouse ? Colors.secondaryContainer_fg : Qt.alpha(Colors.secondary, 0.75)
|
||||
radius: Config.radius
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
// Process {
|
||||
// id: powerOff
|
||||
// command: ["wlogout", "-b", "2"]
|
||||
// stdout: StdioCollector {
|
||||
// onStreamFinished: console.log(`line read: ${this.text}`)
|
||||
// }
|
||||
// }
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
console.log("Running PowerOff Menu")
|
||||
root.openWlogout()
|
||||
}
|
||||
}
|
||||
}
|
||||
border.width: 0
|
||||
|
||||
Text {
|
||||
id: powerText
|
||||
anchors.centerIn: parent
|
||||
text: ""
|
||||
font.pixelSize: Config.big_font_size(bar.height)
|
||||
font.pixelSize: Config.bigIconSize(bar.height)
|
||||
font.family: Config.font
|
||||
color:powerButton.containsMouse ? Colors.secondaryContainer : Colors.secondary_fg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user