Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Assets/Translations/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions Assets/Translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions Assets/Translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Показывать приложения при наведении",
Expand Down
24 changes: 13 additions & 11 deletions Modules/Bar/Extras/WorkspacePill.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -54,17 +55,17 @@ Item {

transitions: [
Transition {
from: "inactive"
to: "active"
from: "default"
to: "large"
NumberAnimation {
properties: isVertical ? "height,pillHeight" : "width,pillWidth"
duration: Style.animationNormal
easing.type: Easing.OutBack
}
},
Transition {
from: "active"
to: "inactive"
from: "large"
to: "default"
NumberAnimation {
properties: isVertical ? "height,pillHeight" : "width,pillWidth"
duration: Style.animationNormal
Expand All @@ -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 {
Expand Down
30 changes: 18 additions & 12 deletions Modules/Bar/Widgets/Workspace.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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") {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -398,8 +401,8 @@ Item {
updateWorkspaceFocus();
}

function triggerUnifiedWave() {
effectColor = Color.mPrimary;
function triggerUnifiedWave(color) {
effectColor = color !== undefined ? color : Color.resolveColorKey(root.focusedColor);
masterAnimation.restart();
}

Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions Services/UI/BarWidgetRegistry.qml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ Singleton {
"Workspace": {
"labelMode": "index",
"followFocusedScreen": false,
"showAll": false,
"largeActive": true,
"hideUnoccupied": false,
"characterCount": 2,
"showApplications": false,
Expand Down