Compare commits

...

2 Commits

Author SHA1 Message Date
e33041b66c barebones logout screen implementation (too lazy to figure out wlr shell stuff rn) 2026-08-12 16:18:19 +01:00
88d867f1de ipc manager 2026-08-12 16:17:49 +01:00
3 changed files with 115 additions and 0 deletions

View File

@@ -15,6 +15,10 @@ Container {
id: root id: root
property Notification latestNotif property Notification latestNotif
property bool logout: false
property double logoutHeight: 100
property double logoutMargin: 7
property double logoutSpacing: 5
required property HyprlandMonitor monitor required property HyprlandMonitor monitor
property bool mpris: false property bool mpris: false
property double mprisHeight: 60 property double mprisHeight: 60
@@ -64,6 +68,24 @@ Container {
mprisTimer.restart(); mprisTimer.restart();
} }
} }
},
State {
name: "logout"
when: root.logout == true
PropertyChanges {
root.boxHeight: root.logoutHeight
root.boxRadius: 13
root.boxWidth: ((root.logoutHeight - (root.logoutMargin * 2)) * 5) + (root.logoutMargin * 2) + (
root.logoutSpacing * 4)
root.visibleTopMargin: 10
}
StateChangeScript {
script: {
root.stack.replace(logoutMenu);
}
}
} }
] ]
@@ -77,6 +99,15 @@ Container {
} }
} }
Connections {
function onLogoutMenu() {
root.overriden = true;
root.logout = true;
}
target: IpcManager
}
Connections { Connections {
function onNewNotification() { function onNewNotification() {
notification => { notification => {
@@ -127,6 +158,48 @@ Container {
} }
} }
Component {
id: logoutMenu
Item {
id: logoutMenuRoot
RowLayout {
spacing: root.logoutSpacing
anchors {
fill: parent
margins: root.logoutMargin
}
LogoutButton {
color: Colors.red
logoutText: "a"
}
LogoutButton {
color: Colors.peach
logoutText: "a"
}
LogoutButton {
color: Colors.yellow
logoutText: "a"
}
LogoutButton {
color: Colors.green
logoutText: "a"
}
LogoutButton {
color: Colors.sky
logoutText: "a"
}
}
}
}
Component { Component {
id: time id: time
@@ -306,4 +379,27 @@ Container {
} }
} }
} }
component LogoutButton: Item {
id: logoutButtonRoot
property color color: Colors.surface1
property string logoutText: ""
Layout.fillHeight: true
Layout.fillWidth: true
Rectangle {
anchors.fill: parent
color: logoutButtonRoot.color
radius: 7
StyledText {
anchors.fill: parent
horizontalAlignment: Qt.AlignHCenter
text: logoutButtonRoot.logoutText
verticalAlignment: Qt.AlignVCenter
}
}
}
} }

18
Services/IpcManager.qml Normal file
View File

@@ -0,0 +1,18 @@
pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Io
Singleton {
id: root
signal logoutMenu
IpcHandler {
function openLogoutMenu(): void {
root.logoutMenu();
}
target: "root"
}
}

View File

@@ -6,3 +6,4 @@ singleton BluetoothManager 1.0 BluetoothManager.qml
singleton MprisManager 1.0 MprisManager.qml singleton MprisManager 1.0 MprisManager.qml
singleton BatteryManager 1.0 BatteryManager.qml singleton BatteryManager 1.0 BatteryManager.qml
singleton NetworkManager 1.0 NetworkManager.qml singleton NetworkManager 1.0 NetworkManager.qml
singleton IpcManager 1.0 IpcManager.qml