From 3dd9ab8a29f07f2f0c598c6ae5db705375090aa7 Mon Sep 17 00:00:00 2001 From: Parthiv Seetharaman Date: Sat, 27 Sep 2025 08:55:21 -0400 Subject: [PATCH] add option to always show dock in overview (#257) --- Common/SettingsData.qml | 8 ++++ Modules/Dock/Dock.qml | 7 +++- Modules/Settings/DockTab.qml | 72 ++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/Common/SettingsData.qml b/Common/SettingsData.qml index c0a2b9d0..ff1ee0b6 100644 --- a/Common/SettingsData.qml +++ b/Common/SettingsData.qml @@ -118,6 +118,7 @@ Singleton { property bool showDock: false property bool dockAutoHide: false property bool dockGroupByApp: false + property bool dockOpenOnOverview: false property real cornerRadius: 12 property bool notificationOverlayEnabled: false property bool dankBarAutoHide: false @@ -316,6 +317,7 @@ Singleton { dankBarAutoHide = settings.dankBarAutoHide !== undefined ? settings.dankBarAutoHide : (settings.topBarAutoHide !== undefined ? settings.topBarAutoHide : false) dankBarOpenOnOverview = settings.dankBarOpenOnOverview !== undefined ? settings.dankBarOpenOnOverview : (settings.topBarOpenOnOverview !== undefined ? settings.topBarOpenOnOverview : false) dankBarVisible = settings.dankBarVisible !== undefined ? settings.dankBarVisible : (settings.topBarVisible !== undefined ? settings.topBarVisible : true) + dockOpenOnOverview = settings.dockOpenOnOverview !== undefined ? settings.dockOpenOnOverview : false notificationTimeoutLow = settings.notificationTimeoutLow !== undefined ? settings.notificationTimeoutLow : 5000 notificationTimeoutNormal = settings.notificationTimeoutNormal !== undefined ? settings.notificationTimeoutNormal : 5000 notificationTimeoutCritical = settings.notificationTimeoutCritical !== undefined ? settings.notificationTimeoutCritical : 0 @@ -425,6 +427,7 @@ Singleton { "showDock": showDock, "dockAutoHide": dockAutoHide, "dockGroupByApp": dockGroupByApp, + "dockOpenOnOverview": dockOpenOnOverview, "cornerRadius": cornerRadius, "notificationOverlayEnabled": notificationOverlayEnabled, "dankBarAutoHide": dankBarAutoHide, @@ -972,6 +975,11 @@ Singleton { saveSettings() } + function setdockOpenOnOverview(enabled) { + dockOpenOnOverview = enabled + saveSettings() + } + function setCornerRadius(radius) { cornerRadius = radius saveSettings() diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index d5b59af7..a966ad81 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -31,7 +31,12 @@ PanelWindow { const fullscreenApps = ["vlc", "mpv", "kodi", "steam", "lutris", "wine", "dosbox"] return fullscreenApps.some(app => activeWindow.appId && activeWindow.appId.toLowerCase().includes(app)) } - property bool reveal: (!autoHide || dockMouseArea.containsMouse || dockApps.requestDockShow || contextMenuOpen) && !windowIsFullscreen + property bool reveal: { + if (CompositorService.isNiri && NiriService.inOverview) { + return SettingsData.dockOpenOnOverview + } + return (!autoHide || dockMouseArea.containsMouse || dockApps.requestDockShow || contextMenuOpen) && !windowIsFullscreen + } Connections { target: SettingsData diff --git a/Modules/Settings/DockTab.qml b/Modules/Settings/DockTab.qml index 316c58f3..53324d34 100644 --- a/Modules/Settings/DockTab.qml +++ b/Modules/Settings/DockTab.qml @@ -154,6 +154,78 @@ Item { } } + // Show Dock in Overview + StyledRect { + width: parent.width + height: overviewSection.implicitHeight + Theme.spacingL * 2 + radius: Theme.cornerRadius + color: Theme.surfaceContainerHigh + border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, + Theme.outline.b, 0.2) + border.width: 0 + visible: SettingsData.showDock + opacity: visible ? 1 : 0 + + Column { + id: overviewSection + + anchors.fill: parent + anchors.margins: Theme.spacingL + spacing: Theme.spacingM + + Row { + width: parent.width + spacing: Theme.spacingM + + DankIcon { + name: "visibility_off" + size: Theme.iconSize + color: Theme.primary + anchors.verticalCenter: parent.verticalCenter + } + + Column { + width: parent.width - Theme.iconSize - Theme.spacingM + - overviewToggle.width - Theme.spacingM + spacing: Theme.spacingXS + anchors.verticalCenter: parent.verticalCenter + + StyledText { + text: "Show on Overview" + font.pixelSize: Theme.fontSizeLarge + font.weight: Font.Medium + color: Theme.surfaceText + } + + StyledText { + text: "Always show the dock when niri's overview is open" + font.pixelSize: Theme.fontSizeSmall + color: Theme.surfaceVariantText + wrapMode: Text.WordWrap + width: parent.width + } + } + + DankToggle { + id: overviewToggle + + anchors.verticalCenter: parent.verticalCenter + checked: SettingsData.dockOpenOnOverview + onToggled: checked => { + SettingsData.setdockOpenOnOverview(checked) + } + } + } + } + + Behavior on opacity { + NumberAnimation { + duration: Theme.mediumDuration + easing.type: Theme.emphasizedEasing + } + } + } + // Group by App StyledRect { width: parent.width