From aaf03d1860760f8fc4ae100d3db3b71ba1d99526 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 5 Dec 2025 10:14:10 +0100 Subject: ... --- accounts/gkleen@sif/shell/quickshell/Bar.qml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'accounts/gkleen@sif/shell') 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 @@ import Quickshell import Quickshell.Wayland import QtQuick +import qs.Services PanelWindow { id: bar WlrLayershell.namespace: "bar" + property bool haveMaximizedWindow: { + let currWindowId = Array.from(NiriService.workspaces).find(ws => { + return ws.output === bar.screen.name && ws.is_active; + })?.active_window_id; + let activeWindowTileSize = Array.from(NiriService.windows).find(win => win.id == currWindowId)?.layout?.tile_size; + + if (!activeWindowTileSize) + return false; + return activeWindowTileSize[0] >= bar.screen.width && activeWindowTileSize[1] >= bar.screen.height - bar.height; + } + anchors { top: true left: true right: true } margins { - left: 26 + 8 - right: 26 + 8 + left: bar.haveMaximizedWindow ? 0 : 26 + 8 + right: bar.haveMaximizedWindow ? 0 : 26 + 8 } implicitHeight: 21 color: "transparent" Rectangle { - color: Qt.rgba(0, 0, 0, 0.75) + color: bar.haveMaximizedWindow ? "black" : Qt.rgba(0, 0, 0, 0.75) anchors.fill: parent // bottomLeftRadius: 8 // bottomRightRadius: 8 -- cgit v1.2.3