diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 342ad285..3dcb1b82 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -373,6 +373,10 @@ "description": "Arbeitsbereiche ohne Fenster nicht anzeigen.", "label": "Unbesetzte ausblenden" }, + "follow-focused-screen": { + "description": "Zeigt Arbeitsbereiche vom aktuell fokussierten Bildschirm an, statt vom Bildschirm, auf dem sich die Leiste befindet.", + "label": "Fokussiertem Bildschirm folgen" + }, "label-mode": { "description": "Wählen Sie, wie Arbeitsbereichs-Beschriftungen angezeigt werden.", "label": "Beschriftungsmodus" diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 3de753ab..ef6bd875 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -373,6 +373,10 @@ "description": "Don't display workspaces without windows.", "label": "Hide unoccupied" }, + "follow-focused-screen": { + "description": "Display workspaces from the currently focused screen, rather than the screen where the bar is located.", + "label": "Follow Focused Screen" + }, "label-mode": { "description": "Choose how workspace labels are displayed.", "label": "Label Mode" diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index ef570fe9..13c6d24e 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -373,6 +373,10 @@ "description": "No mostrar espacios de trabajo sin ventanas.", "label": "Ocultar desocupados" }, + "follow-focused-screen": { + "description": "Mostrar espacios de trabajo de la pantalla actualmente enfocada, en lugar de la pantalla donde se encuentra la barra.", + "label": "Seguir Pantalla Enfocada" + }, "label-mode": { "description": "Elegir cómo se muestran las etiquetas de los espacios de trabajo.", "label": "Modo de etiqueta" diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 42c9b317..76ca5dac 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -373,6 +373,10 @@ "description": "Ne pas afficher les espaces de travail sans fenêtres.", "label": "Masquer les inoccupés" }, + "follow-focused-screen": { + "description": "Afficher les espaces de travail de l'écran actuellement ciblé, plutôt que de l'écran où se trouve la barre.", + "label": "Suivre l'Écran Ciblé" + }, "label-mode": { "description": "Choisir comment les étiquettes d'espace de travail sont affichées.", "label": "Mode d'étiquette" diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index af37179d..8708a07f 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -373,6 +373,10 @@ "description": "Werkruimten zonder vensters niet weergeven.", "label": "Ongebruikte verbergen" }, + "follow-focused-screen": { + "description": "Werkruimten weergeven van het momenteel gefocuste scherm, in plaats van het scherm waar de balk zich bevindt.", + "label": "Gefocust Scherm Volgen" + }, "label-mode": { "description": "Kies hoe labels van werkruimten worden weergegeven.", "label": "Labelmodus" diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 548dda4e..48f6ac33 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -373,6 +373,10 @@ "description": "Não exibir áreas de trabalho sem janelas.", "label": "Ocultar desocupados" }, + "follow-focused-screen": { + "description": "Exibir áreas de trabalho da tela atualmente em foco, em vez da tela onde a barra está localizada.", + "label": "Seguir Tela em Foco" + }, "label-mode": { "description": "Escolher como os rótulos de espaço de trabalho são exibidos.", "label": "Modo de rótulo" diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index d4406702..95ce9cff 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -373,6 +373,10 @@ "description": "Не отображать рабочие пространства без окон.", "label": "Скрыть незанятые" }, + "follow-focused-screen": { + "description": "Отображать рабочие пространства с текущего активного экрана, а не с экрана, на котором расположена панель.", + "label": "Следовать за Активным Экраном" + }, "label-mode": { "description": "Выберите, как отображаются метки рабочих пространств.", "label": "Режим метки" diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 02215719..37642508 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -373,6 +373,10 @@ "description": "Penceresi olmayan çalışma alanlarını gösterme.", "label": "Dolu olmayanları gizle" }, + "follow-focused-screen": { + "description": "Çubuğun bulunduğu ekran yerine, şu anda odaklanmış ekrandaki çalışma alanlarını göster.", + "label": "Odaklanmış Ekranı Takip Et" + }, "label-mode": { "description": "Çalışma alanı etiketlerinin nasıl gösterileceğini seçin.", "label": "Etiket Modu" diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index 6691f9ec..3f5c331e 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -373,6 +373,10 @@ "description": "Не відображати робочі простори без вікон.", "label": "Приховати незайняті" }, + "follow-focused-screen": { + "description": "Відображати робочі простори з поточного активного екрана, а не з екрана, на якому розташована панель.", + "label": "Слідувати за Активним Екраном" + }, "label-mode": { "description": "Виберіть, як відображаються мітки робочих просторів.", "label": "Режим міток" diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index a6a2b1cf..70030835 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -373,6 +373,10 @@ "description": "不显示没有窗口的工作区。", "label": "隐藏未占用" }, + "follow-focused-screen": { + "description": "显示当前焦点屏幕的工作区,而不是任务栏所在屏幕的工作区。", + "label": "跟随焦点屏幕" + }, "label-mode": { "description": "选择工作区标签的显示方式。", "label": "标签模式" diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 325f1a7e..462d4255 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -46,6 +46,7 @@ Item { readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied + readonly property bool followFocusedScreen: (widgetSettings.followFocusedScreen !== undefined) ? widgetSettings.followFocusedScreen : widgetMetadata.followFocusedScreen readonly property int characterCount: isVertical ? 2 : ((widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount) property bool isDestroying: false @@ -162,10 +163,20 @@ Item { function refreshWorkspaces() { localWorkspaces.clear(); + + var focusedOutput = null; + if (followFocusedScreen) { + for (var i = 0; i < CompositorService.workspaces.count; i++) { + const ws = CompositorService.workspaces.get(i); + if (ws.isFocused) focusedOutput = ws.output.toLowerCase(); + } + } + if (screen !== null) { for (var i = 0; i < CompositorService.workspaces.count; i++) { const ws = CompositorService.workspaces.get(i); - if (ws.output.toLowerCase() === screen.name.toLowerCase()) { + if ((followFocusedScreen && ws.output.toLowerCase() == focusedOutput) || + (!followFocusedScreen && ws.output.toLowerCase() == screen.name.toLowerCase())) { if (hideUnoccupied && !ws.isOccupied && !ws.isFocused) { continue; } diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index 0c702563..e807a131 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -14,6 +14,7 @@ ColumnLayout { property string valueLabelMode: widgetData.labelMode !== undefined ? widgetData.labelMode : widgetMetadata.labelMode property bool valueHideUnoccupied: widgetData.hideUnoccupied !== undefined ? widgetData.hideUnoccupied : widgetMetadata.hideUnoccupied + property bool valueFollowFocusedScreen: widgetData.followFocusedScreen !== undefined ? widgetData.followFocusedScreen : widgetMetadata.followFocusedScreen property int valueCharacterCount: widgetData.characterCount !== undefined ? widgetData.characterCount : widgetMetadata.characterCount function saveSettings() { @@ -21,6 +22,7 @@ ColumnLayout { settings.labelMode = valueLabelMode; settings.hideUnoccupied = valueHideUnoccupied; settings.characterCount = valueCharacterCount; + settings.followFocusedScreen = valueFollowFocusedScreen; return settings; } @@ -51,6 +53,13 @@ ColumnLayout { minimumWidth: 200 } + NToggle { + label: I18n.tr("bar.widget-settings.workspace.follow-focused-screen.label") + description: I18n.tr("bar.widget-settings.workspace.follow-focused-screen.description") + checked: valueFollowFocusedScreen + onToggled: checked => valueFollowFocusedScreen = checked + } + NToggle { label: I18n.tr("bar.widget-settings.workspace.hide-unoccupied.label") description: I18n.tr("bar.widget-settings.workspace.hide-unoccupied.description") diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index b34e9795..f064c748 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -223,6 +223,7 @@ Singleton { "Workspace": { "allowUserSettings": true, "labelMode": "index", + "followFocusedScreen": false, "hideUnoccupied": false, "characterCount": 2 },