34
Bar.qml
34
Bar.qml
@@ -1,9 +1,8 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import "./Services/"
|
|
||||||
import "Bar"
|
import "Bar"
|
||||||
import "Color.js" as Colors
|
import "Color.js" as Colors
|
||||||
|
|
||||||
@@ -20,15 +19,6 @@ Scope {
|
|||||||
required property var modelData
|
required property var modelData
|
||||||
property HyprlandMonitor monitor: Hyprland.monitorFor(modelData)
|
property HyprlandMonitor monitor: Hyprland.monitorFor(modelData)
|
||||||
|
|
||||||
function refocus() {
|
|
||||||
if (WlrLayershell == null)
|
|
||||||
return;
|
|
||||||
WlrLayershell.keyboardFocus = WlrKeyboardFocus.None;
|
|
||||||
Qt.callLater(() => {
|
|
||||||
WlrLayershell.keyboardFocus = WlrKeyboardFocus.Exclusive;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
exclusionMode: ExclusionMode.Normal
|
exclusionMode: ExclusionMode.Normal
|
||||||
exclusiveZone: barExclusionZone
|
exclusiveZone: barExclusionZone
|
||||||
@@ -49,26 +39,6 @@ Scope {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (this.WlrLayershell != null) {
|
|
||||||
this.WlrLayershell.keyboardFocus = WlrKeyboardFocus.OnDemand;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onRaiseCancelled() {
|
|
||||||
win.WlrLayershell.keyboardFocus = WlrKeyboardFocus.OnDemand;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onRaiseRequested() {
|
|
||||||
// win.WlrLayershell.keyboardFocus = WlrKeyboardFocus.Exclusive;
|
|
||||||
win.refocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
target: FocusManager
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: true
|
left: true
|
||||||
right: true
|
right: true
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import QtQuick
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Services.Mpris
|
import Quickshell.Services.Mpris
|
||||||
import Quickshell.Services.Notifications
|
import Quickshell.Services.Notifications
|
||||||
import "../Color.js" as Colors
|
import "../Color.js" as Colors
|
||||||
@@ -120,23 +119,6 @@ Container {
|
|||||||
root.previousState = "notified";
|
root.previousState = "notified";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "logout"
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
root.boxHeight: 90
|
|
||||||
root.boxRadius: 30
|
|
||||||
root.boxWidth: 330
|
|
||||||
root.visibleTopMargin: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
StateChangeScript {
|
|
||||||
script: {
|
|
||||||
root.stack.replace(logout);
|
|
||||||
root.previousState = "logout";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -145,8 +127,6 @@ Container {
|
|||||||
if (root.state == "notified") {
|
if (root.state == "notified") {
|
||||||
root.state = "notified";
|
root.state = "notified";
|
||||||
notificationViewTimer.stop();
|
notificationViewTimer.stop();
|
||||||
} else if (root.state == "logout") {
|
|
||||||
root.state = "logout";
|
|
||||||
} else if (MprisManager.getPlaying() == true) {
|
} else if (MprisManager.getPlaying() == true) {
|
||||||
root.state = "mprisToast";
|
root.state = "mprisToast";
|
||||||
} else {
|
} else {
|
||||||
@@ -154,7 +134,6 @@ Container {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
root.state = "";
|
root.state = "";
|
||||||
FocusManager.exitRaise();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onLatestNotificationChanged: {
|
onLatestNotificationChanged: {
|
||||||
@@ -169,32 +148,6 @@ Container {
|
|||||||
root.state == "hovered" ? root.state = "expanded" : undefined;
|
root.state == "hovered" ? root.state = "expanded" : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onactivated() {
|
|
||||||
console.log("some", root.state);
|
|
||||||
}
|
|
||||||
|
|
||||||
target: root.stack
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onLogoutTriggered() {
|
|
||||||
if (Hyprland.focusedMonitor == root.exclusiveMonitor) {
|
|
||||||
root.state = "logout";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: IpcManager
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onRaiseCancelled() {
|
|
||||||
root.state = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
target: FocusManager
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onTrackChanged() {
|
function onTrackChanged() {
|
||||||
if (Hyprland.focusedMonitor == root.monitor) {
|
if (Hyprland.focusedMonitor == root.monitor) {
|
||||||
@@ -307,10 +260,4 @@ Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: logout
|
|
||||||
|
|
||||||
Logout {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import "../../Components/"
|
|
||||||
import "../../Services/"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
CenteredText {
|
|
||||||
text: "some"
|
|
||||||
}
|
|
||||||
|
|
||||||
Shortcut {
|
|
||||||
sequence: "Escape"
|
|
||||||
|
|
||||||
onActivated: {
|
|
||||||
console.log("shortcut triggered");
|
|
||||||
FocusManager.exitRaise();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
signal raiseCancelled
|
|
||||||
signal raiseRequested
|
|
||||||
|
|
||||||
function exitRaise() {
|
|
||||||
console.log("exiting raise");
|
|
||||||
root.raiseCancelled();
|
|
||||||
}
|
|
||||||
|
|
||||||
function requestRaise() {
|
|
||||||
root.raiseRequested();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
signal logoutTriggered()
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function logout() {
|
|
||||||
root.logoutTriggered();
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "main"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,5 +4,3 @@ singleton NotificationManager 1.0 NotificationManager.qml
|
|||||||
singleton WorkspaceManager 1.0 WorkspaceManager.qml
|
singleton WorkspaceManager 1.0 WorkspaceManager.qml
|
||||||
singleton BluetoothManager 1.0 BluetoothManager.qml
|
singleton BluetoothManager 1.0 BluetoothManager.qml
|
||||||
singleton MprisManager 1.0 MprisManager.qml
|
singleton MprisManager 1.0 MprisManager.qml
|
||||||
singleton IpcManager 1.0 IpcManager.qml
|
|
||||||
singleton FocusManager 1.0 FocusManager.qml
|
|
||||||
|
|||||||
Reference in New Issue
Block a user