non important commit
This commit is contained in:
parent
cb2c336e17
commit
069a5df2b9
7 changed files with 259 additions and 171 deletions
86
configuration/modules/dots/quick_shell/config/PowerPopup.qml
Normal file
86
configuration/modules/dots/quick_shell/config/PowerPopup.qml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
PanelWindow {
|
||||
id: powerPopup
|
||||
|
||||
required property bool expanderOpen
|
||||
required property color bgColor
|
||||
required property color recColor
|
||||
required property int recRadius
|
||||
required property int barWidth
|
||||
|
||||
anchors.left: true
|
||||
anchors.bottom: true
|
||||
implicitWidth: (expanderOpen || powerAnim.running) ? 140 : 0
|
||||
implicitHeight: (expanderOpen || powerAnim.running) ? 100 : 0
|
||||
color: "transparent"
|
||||
|
||||
Rectangle {
|
||||
id: powerRectangle
|
||||
|
||||
y: parent.height - height
|
||||
x: powerPopup.expanderOpen ? 0 : -(width + powerPopup.barWidth)
|
||||
width: 140
|
||||
height: 100
|
||||
color: powerPopup.bgColor
|
||||
|
||||
Behavior on x {
|
||||
NumberAnimation {
|
||||
id: powerAnim
|
||||
|
||||
duration: 400
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.centerIn: powerRectangle
|
||||
spacing: 10
|
||||
|
||||
Rectangle {
|
||||
color: powerPopup.recColor
|
||||
width: 50
|
||||
height: 50
|
||||
radius: powerPopup.recRadius * 2
|
||||
|
||||
Button {
|
||||
anchors.fill: parent
|
||||
opacity: 0
|
||||
|
||||
onClicked: Quickshell.execDetached(["poweroff"])
|
||||
}
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "file://" + Quickshell.shellDir + "/assets/power.svg"
|
||||
sourceSize.width: 28
|
||||
sourceSize.height: 28
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
color: powerPopup.recColor
|
||||
width: 50
|
||||
height: 50
|
||||
radius: powerPopup.recRadius * 2
|
||||
|
||||
Button {
|
||||
anchors.fill: parent
|
||||
opacity: 0
|
||||
|
||||
onClicked: Quickshell.execDetached(["reboot"])
|
||||
}
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: "file://" + Quickshell.shellDir + "/assets/reboot.svg"
|
||||
sourceSize.width: 28
|
||||
sourceSize.height: 28
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue