summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell/Bar.qml
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/Bar.qml')
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Bar.qml18
1 files changed, 15 insertions, 3 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/Bar.qml b/accounts/gkleen@sif/shell/quickshell/Bar.qml
index c0ff4dac..54ac2d3c 100644
--- a/accounts/gkleen@sif/shell/quickshell/Bar.qml
+++ b/accounts/gkleen@sif/shell/quickshell/Bar.qml
@@ -1,27 +1,39 @@
1import Quickshell 1import Quickshell
2import Quickshell.Wayland 2import Quickshell.Wayland
3import QtQuick 3import QtQuick
4import qs.Services
4 5
5PanelWindow { 6PanelWindow {
6 id: bar 7 id: bar
7 8
8 WlrLayershell.namespace: "bar" 9 WlrLayershell.namespace: "bar"
9 10
11 property bool haveMaximizedWindow: {
12 let currWindowId = Array.from(NiriService.workspaces).find(ws => {
13 return ws.output === bar.screen.name && ws.is_active;
14 })?.active_window_id;
15 let activeWindowTileSize = Array.from(NiriService.windows).find(win => win.id == currWindowId)?.layout?.tile_size;
16
17 if (!activeWindowTileSize)
18 return false;
19 return activeWindowTileSize[0] >= bar.screen.width && activeWindowTileSize[1] >= bar.screen.height - bar.height;
20 }
21
10 anchors { 22 anchors {
11 top: true 23 top: true
12 left: true 24 left: true
13 right: true 25 right: true
14 } 26 }
15 margins { 27 margins {
16 left: 26 + 8 28 left: bar.haveMaximizedWindow ? 0 : 26 + 8
17 right: 26 + 8 29 right: bar.haveMaximizedWindow ? 0 : 26 + 8
18 } 30 }
19 31
20 implicitHeight: 21 32 implicitHeight: 21
21 color: "transparent" 33 color: "transparent"
22 34
23 Rectangle { 35 Rectangle {
24 color: Qt.rgba(0, 0, 0, 0.75) 36 color: bar.haveMaximizedWindow ? "black" : Qt.rgba(0, 0, 0, 0.75)
25 anchors.fill: parent 37 anchors.fill: parent
26 // bottomLeftRadius: 8 38 // bottomLeftRadius: 8
27 // bottomRightRadius: 8 39 // bottomRightRadius: 8