feat: dash handles multiple monitors
This commit is contained in:
parent
542cacd84c
commit
5e5f265de6
5 changed files with 40 additions and 25 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -23,11 +23,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731691072,
|
||||
"narHash": "sha256-ltqP0INiEErk1BVrMyJoH/WEFLYzNG42tL/i5BOP2gw=",
|
||||
"lastModified": 1731708624,
|
||||
"narHash": "sha256-23K5I4km7evzYB8tXIzi80Lo33kMcpwVtI3H4IiKk7k=",
|
||||
"owner": "nydragon",
|
||||
"repo": "quickshell",
|
||||
"rev": "b9a1a6090bc89e5a8214516cac2bd2c32a95d2f1",
|
||||
"rev": "6ca870d48e1ddb3ae459dda188c2ba9b5213470f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import Quickshell
|
||||
import Quickshell.I3
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQml
|
||||
|
@ -12,10 +11,17 @@ PanelWindow {
|
|||
id: homeWindow
|
||||
|
||||
property bool animRunning: false
|
||||
property bool focused: I3.monitorFor(homeWindow.screen).focused
|
||||
required property bool focused
|
||||
property bool focusLocked: false
|
||||
|
||||
color: "transparent"
|
||||
visible: (animRunning || NyshState.dashOpen) && focused
|
||||
visible: (animRunning || NyshState.dashOpen) && focusLocked
|
||||
|
||||
Component.onCompleted: NyshState.dashOpenChanged.connect(() => {
|
||||
if (NyshState.dashOpen)
|
||||
focusLocked = focused;
|
||||
})
|
||||
|
||||
focusable: true
|
||||
|
||||
anchors {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.I3
|
||||
import "provider"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
@ -10,7 +12,14 @@ Item {
|
|||
screen: root.screen
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
I3.focusedMonitorChanged.connect(e => {
|
||||
dash.focused = I3.monitorFor(root.screen).focused;
|
||||
});
|
||||
}
|
||||
|
||||
property Dashboard dash: Dashboard {
|
||||
screen: root.screen
|
||||
focused: I3.monitorFor(root.screen).focused
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,9 @@ import Quickshell.Io
|
|||
Singleton {
|
||||
id: state
|
||||
property bool dashOpen: false
|
||||
property bool workspaceViewOpen: false
|
||||
|
||||
property IpcHandler ipc: IpcHandler {
|
||||
IpcHandler {
|
||||
target: "dash"
|
||||
|
||||
function toggle() {
|
||||
|
@ -15,6 +16,18 @@ Singleton {
|
|||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "workspace-view"
|
||||
|
||||
function toggle() {
|
||||
state.toggleWorkspaceView();
|
||||
}
|
||||
}
|
||||
|
||||
function toggleWorkspaceView() {
|
||||
state.workspaceViewOpen = !state.workspaceViewOpen;
|
||||
}
|
||||
|
||||
function toggleDash() {
|
||||
state.dashOpen = !state.dashOpen;
|
||||
}
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
import Quickshell
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import Quickshell.I3
|
||||
import QtQuick.Layouts
|
||||
import "../../provider"
|
||||
|
||||
PanelWindow {
|
||||
id: workspaceView
|
||||
|
||||
IpcHandler {
|
||||
target: "workspace-view"
|
||||
|
||||
function toggle() {
|
||||
workspaceView.visible = !workspaceView.visible;
|
||||
}
|
||||
}
|
||||
visible: NyshState.workspaceViewOpen
|
||||
|
||||
focusable: true
|
||||
color: "transparent"
|
||||
width: content?.width ?? 500
|
||||
height: content?.height ?? 500
|
||||
|
||||
GridLayout {
|
||||
id: content
|
||||
|
@ -60,14 +57,4 @@ PanelWindow {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
color: "transparent"
|
||||
|
||||
width: content?.width ?? 500
|
||||
height: content?.height ?? 500
|
||||
visible: false
|
||||
|
||||
Component.onCompleted: () => {
|
||||
I3.focusedWorkspaceChanged.connect(() => workspaceView.visible = false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue