mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
dock: add isolate runninig apps by display option
This commit is contained in:
@@ -305,6 +305,7 @@ Singleton {
|
|||||||
property string dockBorderColor: "surfaceText"
|
property string dockBorderColor: "surfaceText"
|
||||||
property real dockBorderOpacity: 1.0
|
property real dockBorderOpacity: 1.0
|
||||||
property int dockBorderThickness: 1
|
property int dockBorderThickness: 1
|
||||||
|
property bool dockIsolateDisplays: false
|
||||||
|
|
||||||
property bool notificationOverlayEnabled: false
|
property bool notificationOverlayEnabled: false
|
||||||
property int overviewRows: 2
|
property int overviewRows: 2
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ var SPEC = {
|
|||||||
dockBorderColor: { def: "surfaceText" },
|
dockBorderColor: { def: "surfaceText" },
|
||||||
dockBorderOpacity: { def: 1.0, coerce: percentToUnit },
|
dockBorderOpacity: { def: 1.0, coerce: percentToUnit },
|
||||||
dockBorderThickness: { def: 1 },
|
dockBorderThickness: { def: 1 },
|
||||||
|
dockIsolateDisplays: { def: false },
|
||||||
|
|
||||||
notificationOverlayEnabled: { def: false },
|
notificationOverlayEnabled: { def: false },
|
||||||
overviewRows: { def: 2, persist: false },
|
overviewRows: { def: 2, persist: false },
|
||||||
|
|||||||
@@ -65,10 +65,21 @@ Item {
|
|||||||
|
|
||||||
Component.onCompleted: updateModel()
|
Component.onCompleted: updateModel()
|
||||||
|
|
||||||
|
function isOnScreen(toplevel, screenName) {
|
||||||
|
if (!toplevel.screens)
|
||||||
|
return false;
|
||||||
|
for (let i = 0; i < toplevel.screens.length; i++) {
|
||||||
|
if (toplevel.screens[i].name === screenName)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function updateModel() {
|
function updateModel() {
|
||||||
const items = [];
|
const items = [];
|
||||||
const pinnedApps = [...(SessionData.pinnedApps || [])];
|
const pinnedApps = [...(SessionData.pinnedApps || [])];
|
||||||
const sortedToplevels = CompositorService.sortedToplevels;
|
const allToplevels = CompositorService.sortedToplevels;
|
||||||
|
const sortedToplevels = (SettingsData.dockIsolateDisplays && root.dockScreen) ? allToplevels.filter(t => isOnScreen(t, root.dockScreen.name)) : allToplevels;
|
||||||
|
|
||||||
if (root.groupByApp) {
|
if (root.groupByApp) {
|
||||||
const appGroups = new Map();
|
const appGroups = new Map();
|
||||||
@@ -296,7 +307,12 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onGroupByAppChanged: {
|
onGroupByAppChanged: repeater.updateModel()
|
||||||
repeater.updateModel();
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onDockIsolateDisplaysChanged() {
|
||||||
|
repeater.updateModel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,13 @@ Item {
|
|||||||
iconName: "apps"
|
iconName: "apps"
|
||||||
title: I18n.tr("Behavior")
|
title: I18n.tr("Behavior")
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Isolate Displays")
|
||||||
|
description: I18n.tr("Only show windows from the current monitor on each dock")
|
||||||
|
checked: SettingsData.dockIsolateDisplays
|
||||||
|
onToggled: checked => SettingsData.set("dockIsolateDisplays", checked)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
text: I18n.tr("Group by App")
|
text: I18n.tr("Group by App")
|
||||||
description: I18n.tr("Group multiple windows of the same app together with a window count indicator")
|
description: I18n.tr("Group multiple windows of the same app together with a window count indicator")
|
||||||
|
|||||||
Reference in New Issue
Block a user