2024-03-08 12:30:51 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import Quickshell
|
|
|
|
import Quickshell.Io
|
|
|
|
import Quickshell.Wayland
|
|
|
|
|
|
|
|
Variants {
|
|
|
|
id: root
|
|
|
|
property color backgroundColor: "#e60c0c0c"
|
|
|
|
property color buttonColor: "#1e1e1e"
|
|
|
|
property color buttonHoverColor: "#3700b3"
|
2024-03-11 13:01:19 +00:00
|
|
|
default property list<LogoutButton> buttons
|
2024-03-08 12:30:51 +00:00
|
|
|
|
2024-03-14 12:00:53 +00:00
|
|
|
model: Quickshell.screens
|
2024-03-08 12:30:51 +00:00
|
|
|
PanelWindow {
|
|
|
|
id: w
|
|
|
|
|
2024-03-14 12:00:53 +00:00
|
|
|
property var modelData
|
|
|
|
screen: modelData
|
|
|
|
|
2024-03-08 12:30:51 +00:00
|
|
|
exclusionMode: ExclusionMode.Ignore
|
2024-03-11 13:01:19 +00:00
|
|
|
WlrLayershell.layer: WlrLayer.Overlay
|
|
|
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
2024-03-08 12:30:51 +00:00
|
|
|
|
|
|
|
color: "transparent"
|
|
|
|
|
|
|
|
contentItem {
|
|
|
|
focus: true
|
|
|
|
Keys.onPressed: event => {
|
|
|
|
if (event.key == Qt.Key_Escape) Qt.quit();
|
|
|
|
else {
|
|
|
|
for (let i = 0; i < buttons.length; i++) {
|
|
|
|
let button = buttons[i];
|
|
|
|
if (event.key == button.keybind) button.exec();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
top: true
|
|
|
|
left: true
|
|
|
|
bottom: true
|
|
|
|
right: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
color: backgroundColor;
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: Qt.quit()
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
|
|
width: parent.width * 0.75
|
|
|
|
height: parent.height * 0.75
|
|
|
|
|
|
|
|
columns: 3
|
|
|
|
columnSpacing: 0
|
|
|
|
rowSpacing: 0
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: buttons
|
|
|
|
delegate: Rectangle {
|
2024-03-11 13:01:19 +00:00
|
|
|
required property LogoutButton modelData;
|
2024-03-08 12:30:51 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
color: ma.containsMouse ? buttonHoverColor : buttonColor
|
|
|
|
border.color: "black"
|
|
|
|
border.width: ma.containsMouse ? 0 : 1
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: ma
|
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
|
|
|
onClicked: modelData.exec()
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: icon
|
|
|
|
anchors.centerIn: parent
|
|
|
|
source: `icons/${modelData.icon}.png`
|
|
|
|
width: parent.width * 0.25
|
|
|
|
height: parent.width * 0.25
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors {
|
|
|
|
top: icon.bottom
|
|
|
|
topMargin: 20
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
text: modelData.text
|
|
|
|
font.pointSize: 20
|
|
|
|
color: "white"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|