From 99b63a275679ac98d32e36a66f06420350eb8f71 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 29 Apr 2026 17:36:57 +0200 Subject: [PATCH] dock: add bar strip with pin toggle when pinned, hide from main bar --- shell/dock/AppletDock.qml | 47 +++++++++++++++++++++++++++++++++++- shell/modules/DockModule.qml | 2 +- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/shell/dock/AppletDock.qml b/shell/dock/AppletDock.qml index aad19e7..6febda3 100644 --- a/shell/dock/AppletDock.qml +++ b/shell/dock/AppletDock.qml @@ -136,10 +136,55 @@ PanelWindow { } } + // Dock bar - mirrors main bar style, hosts dock toggle when pinned + Item { + id: _dockBar + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: S.Theme.barHeight + visible: S.DockState.mode === "pinned" + + transform: Translate { + x: root._slideX + } + + Rectangle { + anchors.fill: parent + color: S.Theme.base00 + } + + // Bottom border - gradient matching bar style (base0C to base09, but just the right end) + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 1 + color: S.Theme.base09 + } + + // Dock toggle + M.BarGroup { + anchors.centerIn: parent + M.BarModule { + tooltip: "Unpin dock" + onTapped: S.DockState.toggle() + + M.BarIcon { + icon: "\uDB80\uDD8B" + anchors.verticalCenter: parent.verticalCenter + } + } + } + } + // Content - inset past the edge line + gap Flickable { id: _flickable - anchors.fill: parent + anchors.top: _dockBar.visible ? _dockBar.bottom : parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom anchors.leftMargin: S.Theme.groupSpacing + 1 contentHeight: _column.height clip: true diff --git a/shell/modules/DockModule.qml b/shell/modules/DockModule.qml index 49fc28f..016ee0f 100644 --- a/shell/modules/DockModule.qml +++ b/shell/modules/DockModule.qml @@ -4,7 +4,7 @@ import "../services" as S M.BarModule { id: root - active: S.Modules.dock.enable + active: S.Modules.dock.enable && S.DockState.mode !== "pinned" tooltip: S.DockState.open ? "Close dock" : "Open dock" onTapped: S.DockState.toggle()