From fdc61acfe43bbabbdb59244dd9c073898d634469 Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Tue, 30 Sep 2025 23:01:46 +0200 Subject: [PATCH 1/4] Dock: Add option to filter by output. --- Assets/Translations/en.json | 14 +++++++++----- Commons/Settings.qml | 1 + Modules/Dock/Dock.qml | 8 +++++++- Modules/Settings/Tabs/DockTab.qml | 7 +++++++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 4d307af2..5e272038 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -2,7 +2,7 @@ "settings": { "general": { "title": "General", - + "profile": { "section": { "label": "Profile", @@ -285,6 +285,10 @@ "section": { "label": "Monitor display", "description": "Choose which monitor to display the dock on." + }, + "only-same-output": { + "label": "Only apps from same output", + "description": "Show only apps from the output where the dock is located." } } }, @@ -1162,7 +1166,7 @@ "enter-width-pixels": "Enter width in pixels", "enter-command": "Enter command to execute (app or custom script)", "command-example": "echo \"Hello World\"", - + "search-wallpapers": "Type to filter wallpapers...", "search-launcher": "Search entries... or use > for commands", "search": "Search...", @@ -1264,7 +1268,7 @@ "lock-subtitle": "Lock your session", "lock-and-suspend": "Lock and Suspend", "lock-and-suspend-subtitle": "Lock session and put system to sleep", - "suspend": "Suspend", + "suspend": "Suspend", "suspend-subtitle": "Put system to sleep", "reboot": "Reboot", "reboot-subtitle": "Restart your computer", @@ -1385,7 +1389,7 @@ }, "weather": { "clear-sky": "Clear sky", - "mainly-clear": "Mainly clear", + "mainly-clear": "Mainly clear", "partly-cloudy": "Partly cloudy", "overcast": "Overcast", "fog": "Fog", @@ -1395,7 +1399,7 @@ "thunderstorm": "Thunderstorm", "unknown": "Unknown" }, - + "authentication": { "failed": "Authentication failed", "error": "Authentication error" diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 8b581e8b..e52f663c 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -247,6 +247,7 @@ Singleton { property bool exclusive: false property real backgroundOpacity: 1.0 property real floatingRatio: 1.0 + property bool onlySameOutput: true property list monitors: [] // Desktop entry IDs pinned to the dock (e.g., "org.kde.konsole", "firefox.desktop") property list pinnedApps: [] diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 57df42ec..8f31af3b 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -51,6 +51,9 @@ Variants { function onPinnedAppsChanged() { updateDockApps() } + function onOnlySameOutputChanged() { + updateDockApps() + } } // Initial update when component is ready @@ -108,7 +111,10 @@ Variants { // Strategy: Maintain app positions as much as possible // 1. First pass: Add all running apps (both pinned and non-pinned) in their current order runningApps.forEach(toplevel => { - if (toplevel && toplevel.appId) { + if ( + toplevel && toplevel.appId + && !(Settings.data.dock.onlySameOutput && toplevel.screens && !toplevel.screens.includes(modelData)) + ) { const isPinned = pinnedApps.includes(toplevel.appId) const appType = isPinned ? "pinned-running" : "running" diff --git a/Modules/Settings/Tabs/DockTab.qml b/Modules/Settings/Tabs/DockTab.qml index c3b1d559..55af3a6a 100644 --- a/Modules/Settings/Tabs/DockTab.qml +++ b/Modules/Settings/Tabs/DockTab.qml @@ -118,6 +118,13 @@ ColumnLayout { } } + NToggle { + label: I18n.tr("settings.dock.monitors.only-same-output.label") + description: I18n.tr("settings.dock.monitors.only-same-output.description") + checked: Settings.data.dock.onlySameOutput + onToggled: checked => Settings.data.dock.onlySameOutput = checked + } + NDivider { Layout.fillWidth: true Layout.topMargin: Style.marginXL * scaling From ec2fbb53dc2a234914ea2a356761a8f263f5768b Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Tue, 30 Sep 2025 23:02:13 +0200 Subject: [PATCH 2/4] Dock: Allow showing the dock on outputs without a bar. --- Modules/Dock/Dock.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 8f31af3b..8260037f 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -196,7 +196,7 @@ Variants { // PEEK WINDOW - Always visible when auto-hide is enabled Loader { - active: barIsReady && modelData && Settings.data.dock.monitors.includes(modelData.name) && autoHide + active: (barIsReady || !hasBar) && modelData && Settings.data.dock.monitors.includes(modelData.name) && autoHide sourceComponent: PanelWindow { id: peekWindow @@ -242,7 +242,7 @@ Variants { // DOCK WINDOW Loader { - active: barIsReady && modelData && Settings.data.dock.monitors.includes(modelData.name) && dockLoaded && ToplevelManager && (dockApps.length > 0) + active: (barIsReady || !hasBar) && modelData && Settings.data.dock.monitors.includes(modelData.name) && dockLoaded && ToplevelManager && (dockApps.length > 0) sourceComponent: PanelWindow { id: dockWindow From 6d05a205561018aa37b1ab62d543fe12a8dd7195 Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Tue, 30 Sep 2025 23:03:09 +0200 Subject: [PATCH 3/4] Dock: Reformat code. --- Modules/Dock/Dock.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Modules/Dock/Dock.qml b/Modules/Dock/Dock.qml index 8260037f..5652deae 100644 --- a/Modules/Dock/Dock.qml +++ b/Modules/Dock/Dock.qml @@ -111,10 +111,7 @@ Variants { // Strategy: Maintain app positions as much as possible // 1. First pass: Add all running apps (both pinned and non-pinned) in their current order runningApps.forEach(toplevel => { - if ( - toplevel && toplevel.appId - && !(Settings.data.dock.onlySameOutput && toplevel.screens && !toplevel.screens.includes(modelData)) - ) { + if (toplevel && toplevel.appId && !(Settings.data.dock.onlySameOutput && toplevel.screens && !toplevel.screens.includes(modelData))) { const isPinned = pinnedApps.includes(toplevel.appId) const appType = isPinned ? "pinned-running" : "running" From 4fb1e2de1efb24c50f1a9bd632f95f5131911ce1 Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Tue, 30 Sep 2025 23:07:24 +0200 Subject: [PATCH 4/4] i18n: Add German translation for new dock settings. --- Assets/Translations/de.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index c81f4eb8..009125f4 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -2,7 +2,7 @@ "settings": { "general": { "title": "Allgemein", - + "profile": { "section": { "label": "Profil", @@ -245,6 +245,10 @@ "section": { "label": "Monitor-Anzeige", "description": "Statusleiste auf bestimmten Monitoren anzeigen. Standard ist alle, wenn keine ausgewählt sind." + }, + "only-same-output": { + "label": "Nur Apps vom gleichen Bildschirm", + "description": "Zeige nur Apps vom dem Bildschirm an, wo sich das Dock befindet." } } }, @@ -1170,7 +1174,7 @@ "enter-width-pixels": "Breite in Pixeln eingeben", "enter-command": "Befehl eingeben (App oder benutzerdefiniertes Skript)", "command-example": "echo \"Hallo Welt\"", - + "search-wallpapers": "Zum Filtern von Hintergrundbildern eingeben...", "search-launcher": "Einträge suchen... oder > für Befehle verwenden", "search": "Suchen...", @@ -1242,7 +1246,7 @@ "frame-rates": { "fps": "{fps} FPS" }, - + "screen-recording": { "sources": { "portal": "Portal",