workspace: variable pill size via settings

This commit is contained in:
Lemmy
2026-02-02 18:57:46 -05:00
parent b3b488cf6c
commit 5c2eed9353
4 changed files with 26 additions and 3 deletions
+2
View File
@@ -276,6 +276,8 @@
"label-mode-label": "Label mode",
"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 (50%-100%).",
"pill-size-label": "Pill size",
"reverse-scrolling-description": "Reverse the direction of workspace switching when scrolling.",
"reverse-scrolling-label": "Reverse scrolling",
"show-applications-description": "Display application icons inside each workspace.",
+5 -2
View File
@@ -48,8 +48,11 @@ Item {
readonly property bool followFocusedScreen: (widgetSettings.followFocusedScreen !== undefined) ? widgetSettings.followFocusedScreen : widgetMetadata.followFocusedScreen
readonly property int characterCount: isVertical ? 2 : ((widgetSettings.characterCount !== undefined) ? widgetSettings.characterCount : widgetMetadata.characterCount)
// Pill size setting (0.5-1.0 range)
readonly property real pillSize: (widgetSettings.pillSize !== undefined) ? widgetSettings.pillSize : widgetMetadata.pillSize
// When no label the pills are smaller
readonly property real baseDimensionRatio: (widgetSettings.labelMode === "none" ? 0.5 : 0.6)
readonly property real baseDimensionRatio: pillSize
// Grouped mode (show applications) settings
readonly property bool showApplications: (widgetSettings.showApplications !== undefined) ? widgetSettings.showApplications : widgetMetadata.showApplications
@@ -597,7 +600,7 @@ Item {
required property var model
workspace: model
isVertical: true
baseDimensionRatio: root.baseDimensionRatio * 0.9 // slightly smaller in vertical mode
baseDimensionRatio: root.baseDimensionRatio
capsuleHeight: root.capsuleHeight
barHeight: root.barHeight
labelMode: root.labelMode
@@ -32,6 +32,7 @@ ColumnLayout {
property string valueOccupiedColor: widgetData.occupiedColor !== undefined ? widgetData.occupiedColor : widgetMetadata.occupiedColor
property string valueEmptyColor: widgetData.emptyColor !== undefined ? widgetData.emptyColor : widgetMetadata.emptyColor
property bool valueShowBadge: widgetData.showBadge !== undefined ? widgetData.showBadge : widgetMetadata.showBadge
property real valuePillSize: widgetData.pillSize !== undefined ? widgetData.pillSize : widgetMetadata.pillSize
function saveSettings() {
var settings = Object.assign({}, widgetData || {});
@@ -51,6 +52,7 @@ ColumnLayout {
settings.occupiedColor = valueOccupiedColor;
settings.emptyColor = valueEmptyColor;
settings.showBadge = valueShowBadge;
settings.pillSize = valuePillSize;
return settings;
}
@@ -97,6 +99,21 @@ ColumnLayout {
visible: valueLabelMode === "name"
}
NValueSlider {
label: I18n.tr("bar.workspace.pill-size-label")
description: I18n.tr("bar.workspace.pill-size-description")
from: 0.4
to: 1.0
stepSize: 0.01
value: valuePillSize
onMoved: value => {
valuePillSize = value;
settingsChanged(saveSettings());
}
text: Math.round(valuePillSize * 100) + "%"
visible: !valueShowApplications
}
NToggle {
label: I18n.tr("bar.workspace.hide-unoccupied-label")
description: I18n.tr("bar.workspace.hide-unoccupied-description")
+2 -1
View File
@@ -256,7 +256,8 @@ Singleton {
"occupiedColor": "secondary",
"emptyColor": "secondary",
"showBadge": true,
"reverseScroll": false
"reverseScroll": false,
"pillSize": 0.6
},
"Volume": {
"displayMode": "onhover",