diff --git a/Assets/Translations/en-GB.json b/Assets/Translations/en-GB.json index 38ed26c1e2..152d85a7c0 100644 --- a/Assets/Translations/en-GB.json +++ b/Assets/Translations/en-GB.json @@ -316,12 +316,16 @@ "hide-unoccupied-label": "Hide unoccupied", "label-mode-description": "Choose how workspace labels are displayed.", "label-mode-label": "Label mode", + "large-active-description": "Make the size of active workspaces same as focused one.", + "large-active-label": "Large active workspaces", "occupied-color-description": "Set the background colour for occupied workspaces.", "occupied-color-label": "Occupied workspace colour", "pill-size-description": "Adjust the size of workspace pills.", "pill-size-label": "Pill size", "reverse-scrolling-description": "Reverse the direction of workspace switching when scrolling.", "reverse-scrolling-label": "Reverse scrolling", + "show-all-description": "Display workspaces from all screens, rather than the screen where the bar is located.", + "show-all-label": "Show all workspaces", "show-applications-description": "Display application icons inside each workspace.", "show-applications-hover-description": "Display application icons inside each workspace when the workspace is hovered.", "show-applications-hover-label": "Show applications when hovered", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 24dca05a72..8ad504af48 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -316,12 +316,16 @@ "hide-unoccupied-label": "Hide unoccupied", "label-mode-description": "Choose how workspace labels are displayed.", "label-mode-label": "Label mode", + "large-active-description": "Make the size of active workspaces same as focused one.", + "large-active-label": "Large active workspaces", "occupied-color-description": "Set the background color for occupied workspaces.", "occupied-color-label": "Occupied workspace color", "pill-size-description": "Adjust the size of workspace pills.", "pill-size-label": "Pill size", "reverse-scrolling-description": "Reverse the direction of workspace switching when scrolling.", "reverse-scrolling-label": "Reverse scrolling", + "show-all-description": "Display workspaces from all screens, rather than the screen where the bar is located.", + "show-all-label": "Show all workspaces", "show-applications-description": "Display application icons inside each workspace.", "show-applications-hover-description": "Display application icons inside each workspace when the workspace is hovered.", "show-applications-hover-label": "Show applications when hovered", diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index d7243250a0..6db68564b6 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -316,12 +316,16 @@ "hide-unoccupied-label": "Скрыть незанятые", "label-mode-description": "Выберите, как отображаются метки рабочих пространств.", "label-mode-label": "Режим метки", + "large-active-description": "Сделать размер активного рабочего пространства таким же как и пространства в фокусе.", + "large-active-label": "Увеличенные активные пространства", "occupied-color-description": "Установить цвет фона для занятых рабочих пространств.", "occupied-color-label": "Цвет занятого рабочего пространства", "pill-size-description": "Отрегулируйте размер индикаторов рабочих пространств (50%-100%).", "pill-size-label": "Размер капсулы", "reverse-scrolling-description": "Изменить направление переключения рабочих пространств при прокрутке.", "reverse-scrolling-label": "Обратная прокрутка", + "show-all-description": "Отображать рабочие пространства со всех экранов, а не только с экрана, на котором расположена панель.", + "show-all-label": "Отображать все пространства", "show-applications-description": "Отображать значки приложений внутри каждого рабочего пространства.", "show-applications-hover-description": "Отображать значки приложений внутри каждого рабочего пространства при наведении на него.", "show-applications-hover-label": "Показывать приложения при наведении", diff --git a/Modules/Bar/Extras/WorkspacePill.qml b/Modules/Bar/Extras/WorkspacePill.qml index 149879e167..0fcddf82b7 100644 --- a/Modules/Bar/Extras/WorkspacePill.qml +++ b/Modules/Bar/Extras/WorkspacePill.qml @@ -17,6 +17,7 @@ Item { required property int fontWeight required property int characterCount required property real textRatio + required property bool largeActive required property bool showLabelsOnlyWhenOccupied required property string focusedColor required property string occupiedColor @@ -40,8 +41,8 @@ Item { states: [ State { - name: "active" - when: workspace.isActive + name: "large" + when: largeActive ? workspace.isActive : workspace.isFocused PropertyChanges { target: pillContainer width: isVertical ? barHeight : getWorkspaceWidth(workspace, true) @@ -54,8 +55,8 @@ Item { transitions: [ Transition { - from: "inactive" - to: "active" + from: "default" + to: "large" NumberAnimation { properties: isVertical ? "height,pillHeight" : "width,pillWidth" duration: Style.animationNormal @@ -63,8 +64,8 @@ Item { } }, Transition { - from: "active" - to: "inactive" + from: "large" + to: "default" NumberAnimation { properties: isVertical ? "height,pillHeight" : "width,pillWidth" duration: Style.animationNormal @@ -83,15 +84,16 @@ Item { z: 0 color: { + const alpha = (workspace.matchesScreen) ? 1.0 : 0.6; if (pillMouseArea.containsMouse) - return Color.mHover; + return Qt.alpha(Color.mHover, alpha); if (workspace.isFocused) - return Color.resolveColorKey(focusedColor); + return Qt.alpha(Color.resolveColorKey(focusedColor), alpha); if (workspace.isUrgent) - return Color.mError; + return Qt.alpha(Color.mError, alpha); if (workspace.isOccupied) - return Color.resolveColorKey(occupiedColor); - return Qt.alpha(Color.resolveColorKey(emptyColor), 0.3); + return Qt.alpha(Color.resolveColorKey(occupiedColor), alpha); + return Qt.alpha(Color.resolveColorKey(emptyColor), 0.3 * alpha); } Loader { diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index c961036205..3b54ea4024 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -57,8 +57,10 @@ Item { return Style.fontWeightBold; return Style.fontWeightBold; } + readonly property bool largeActive: (widgetSettings.largeActive !== undefined) ? widgetSettings.largeActive : widgetMetadata.largeActive readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied readonly property bool followFocusedScreen: (widgetSettings.followFocusedScreen !== undefined) ? widgetSettings.followFocusedScreen : widgetMetadata.followFocusedScreen + readonly property bool showAll: (widgetSettings.showAll !== undefined) ? widgetSettings.showAll : widgetMetadata.showAll readonly property int characterCount: { const count = (widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount; return isVertical ? Math.min(count, 2) : count; @@ -120,7 +122,7 @@ Item { property int lastFocusedWorkspaceId: -1 property real masterProgress: 0.0 property bool effectsActive: false - property color effectColor: Color.mPrimary + property color effectColor: Color.resolveColorKey(root.focusedColor) property int horizontalPadding: Style.marginS property int spacingBetweenPills: Style.marginXS @@ -160,10 +162,10 @@ Item { implicitWidth: appVisible ? (isVertical ? groupedGrid.implicitWidth : Math.round(groupedGrid.implicitWidth + horizontalPadding * hasLabel)) : (isVertical ? barHeight : computeWidth()) implicitHeight: appVisible ? (isVertical ? Math.round(groupedGrid.implicitHeight + horizontalPadding * 0.6 * hasLabel) : barHeight) : (isVertical ? computeHeight() : barHeight) - function getWorkspaceWidth(ws, activeOverride) { + function getWorkspaceWidth(ws, largeOverride) { const d = Math.round(capsuleHeight * root.baseDimensionRatio); - const isActive = activeOverride !== undefined ? activeOverride : ws.isActive; - const factor = isActive ? 2.2 : 1; + const isLarge = largeOverride !== undefined ? largeOverride : (largeActive ? ws.isActive : ws.isFocused); + const factor = isLarge ? 2.2 : 1; // Don't calculate text width if labels are off if (labelMode === "none") { @@ -185,10 +187,10 @@ Item { return Style.toOdd(Math.max(d * factor, textWidth + padding)); } - function getWorkspaceHeight(ws, activeOverride) { + function getWorkspaceHeight(ws, largeOverride) { const d = Math.round(capsuleHeight * root.baseDimensionRatio); - const isActive = activeOverride !== undefined ? activeOverride : ws.isActive; - const factor = isActive ? 2.2 : 1; + const isLarge = largeOverride !== undefined ? largeOverride : (largeActive ? ws.isActive : ws.isFocused); + const factor = isLarge ? 2.2 : 1; return Style.toOdd(d * factor); } @@ -342,7 +344,7 @@ Item { // For global workspaces (e.g., LabWC), show all workspaces on all screens const matchesScreen = CompositorService.globalWorkspaces || (followFocusedScreen && ws.output.toLowerCase() == focusedOutput) || (!followFocusedScreen && ws.output.toLowerCase() == screenName); - if (!matchesScreen) + if (!matchesScreen && !showAll) continue; if (hideUnoccupied && !ws.isOccupied && !ws.isFocused) continue; @@ -356,7 +358,8 @@ Item { isFocused: ws.isFocused, isActive: ws.isActive, isUrgent: ws.isUrgent, - isOccupied: ws.isOccupied + isOccupied: ws.isOccupied, + matchesScreen: matchesScreen }; if (ws.handle !== null && ws.handle !== undefined) { @@ -398,8 +401,8 @@ Item { updateWorkspaceFocus(); } - function triggerUnifiedWave() { - effectColor = Color.mPrimary; + function triggerUnifiedWave(color) { + effectColor = color !== undefined ? color : Color.resolveColorKey(root.focusedColor); masterAnimation.restart(); } @@ -408,7 +411,8 @@ Item { const ws = localWorkspaces.get(i); if (ws.isFocused === true) { if (root.lastFocusedWorkspaceId !== -1 && root.lastFocusedWorkspaceId !== ws.id) { - root.triggerUnifiedWave(); + const waveColor = ws.matchesScreen ? Color.resolveColorKey(root.focusedColor) : Qt.alpha(Color.resolveColorKey(root.focusedColor), 0.6); + root.triggerUnifiedWave(waveColor); } root.lastFocusedWorkspaceId = ws.id; root.workspaceChanged(ws.id, Color.mPrimary); @@ -627,6 +631,7 @@ Item { fontWeight: root.fontWeight characterCount: root.characterCount textRatio: root.textRatio + largeActive: root.largeActive showLabelsOnlyWhenOccupied: root.showLabelsOnlyWhenOccupied focusedColor: root.focusedColor occupiedColor: root.occupiedColor @@ -670,6 +675,7 @@ Item { fontWeight: root.fontWeight characterCount: root.characterCount textRatio: root.textRatio + largeActive: root.largeActive showLabelsOnlyWhenOccupied: root.showLabelsOnlyWhenOccupied focusedColor: root.focusedColor occupiedColor: root.occupiedColor diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index 5606df0816..8affc22ddf 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -16,8 +16,10 @@ ColumnLayout { signal settingsChanged(var settings) property string valueLabelMode: widgetData.labelMode !== undefined ? widgetData.labelMode : widgetMetadata.labelMode + property bool valueLargeActive: widgetData.largeActive !== undefined ? widgetData.largeActive : widgetMetadata.largeActive property bool valueHideUnoccupied: widgetData.hideUnoccupied !== undefined ? widgetData.hideUnoccupied : widgetMetadata.hideUnoccupied property bool valueFollowFocusedScreen: widgetData.followFocusedScreen !== undefined ? widgetData.followFocusedScreen : widgetMetadata.followFocusedScreen + property bool valueShowAll: widgetData.showAll !== undefined ? widgetData.showAll : widgetMetadata.showAll property int valueCharacterCount: widgetData.characterCount !== undefined ? widgetData.characterCount : widgetMetadata.characterCount // Grouped mode settings @@ -39,9 +41,11 @@ ColumnLayout { function saveSettings() { var settings = Object.assign({}, widgetData || {}); settings.labelMode = valueLabelMode; + settings.largeActive = valueLargeActive; settings.hideUnoccupied = valueHideUnoccupied; settings.characterCount = valueCharacterCount; settings.followFocusedScreen = valueFollowFocusedScreen; + settings.showAll = valueShowAll; settings.showApplications = valueShowApplications; settings.showApplicationsHover = valueShowApplicationsHover; settings.showLabelsOnlyWhenOccupied = valueShowLabelsOnlyWhenOccupied; @@ -149,6 +153,16 @@ ColumnLayout { minimumWidth: 200 } + NToggle { + label: I18n.tr("bar.workspace.large-active-label") + description: I18n.tr("bar.workspace.large-active-description") + checked: valueLargeActive + onToggled: checked => { + valueLargeActive = checked; + saveSettings(); + } + } + NToggle { label: I18n.tr("bar.workspace.hide-unoccupied-label") description: I18n.tr("bar.workspace.hide-unoccupied-description") @@ -179,6 +193,16 @@ ColumnLayout { } } + NToggle { + label: I18n.tr("bar.workspace.show-all-label") + description: I18n.tr("bar.workspace.show-all-description") + checked: valueShowAll + onToggled: checked => { + valueShowAll = checked; + saveSettings(); + } + } + NToggle { label: I18n.tr("bar.workspace.enable-scrollwheel-label") description: I18n.tr("bar.workspace.enable-scrollwheel-description") diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 815c820224..648901879e 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -294,6 +294,8 @@ Singleton { "Workspace": { "labelMode": "index", "followFocusedScreen": false, + "showAll": false, + "largeActive": true, "hideUnoccupied": false, "characterCount": 2, "showApplications": false,