Dock: Add option to filter by output.

This commit is contained in:
Leopold Luley
2025-09-30 23:01:46 +02:00
parent 32712c7052
commit fdc61acfe4
4 changed files with 24 additions and 6 deletions
+9 -5
View File
@@ -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"
+1
View File
@@ -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<string> monitors: []
// Desktop entry IDs pinned to the dock (e.g., "org.kde.konsole", "firefox.desktop")
property list<string> pinnedApps: []
+7 -1
View File
@@ -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"
+7
View File
@@ -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