Compare commits
2 Commits
b09039cabb
...
e33041b66c
| Author | SHA1 | Date | |
|---|---|---|---|
| e33041b66c | |||
| 88d867f1de |
96
Bar/Time.qml
96
Bar/Time.qml
@@ -15,6 +15,10 @@ Container {
|
||||
id: root
|
||||
|
||||
property Notification latestNotif
|
||||
property bool logout: false
|
||||
property double logoutHeight: 100
|
||||
property double logoutMargin: 7
|
||||
property double logoutSpacing: 5
|
||||
required property HyprlandMonitor monitor
|
||||
property bool mpris: false
|
||||
property double mprisHeight: 60
|
||||
@@ -64,6 +68,24 @@ Container {
|
||||
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 {
|
||||
function onNewNotification() {
|
||||
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 {
|
||||
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
18
Services/IpcManager.qml
Normal 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"
|
||||
}
|
||||
}
|
||||
@@ -6,3 +6,4 @@ singleton BluetoothManager 1.0 BluetoothManager.qml
|
||||
singleton MprisManager 1.0 MprisManager.qml
|
||||
singleton BatteryManager 1.0 BatteryManager.qml
|
||||
singleton NetworkManager 1.0 NetworkManager.qml
|
||||
singleton IpcManager 1.0 IpcManager.qml
|
||||
|
||||
Reference in New Issue
Block a user