diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index f9899433b..7eaa58c62 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -303,6 +303,8 @@ "occupied-color-label": "Occupied workspace color", "pill-size-description": "Adjust the size of workspace pills.", "pill-size-label": "Pill size", + "font-weight-description": "Set the visual weight for text within workspace.", + "font-weight-label": "Font weight", "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.", @@ -426,6 +428,11 @@ "execute": "Execute", "faithful": "Faithful", "focus": "Focus", + "font-weight-light": "Light", + "font-weight-regular": "Regular", + "font-weight-medium": "Medium", + "font-weight-semibold": "Semi-bold", + "font-weight-bold": "Bold", "frequency": "Frequency", "gateway": "Gateway", "general": "General", diff --git a/Assets/settings-widgets-default.json b/Assets/settings-widgets-default.json index f6d2b41fb..08f9659da 100644 --- a/Assets/settings-widgets-default.json +++ b/Assets/settings-widgets-default.json @@ -225,7 +225,8 @@ "occupiedColor": "secondary", "emptyColor": "secondary", "showBadge": true, - "pillSize": 0.6 + "pillSize": 0.6, + "fontWeight": "bold" }, "Volume": { "displayMode": "onhover", @@ -280,4 +281,4 @@ "layout": "bottom" } } -} \ No newline at end of file +} diff --git a/Modules/Bar/Extras/WorkspacePill.qml b/Modules/Bar/Extras/WorkspacePill.qml index a68ee389e..149879e16 100644 --- a/Modules/Bar/Extras/WorkspacePill.qml +++ b/Modules/Bar/Extras/WorkspacePill.qml @@ -14,6 +14,7 @@ Item { required property real capsuleHeight required property real barHeight required property string labelMode + required property int fontWeight required property int characterCount required property real textRatio required property bool showLabelsOnlyWhenOccupied @@ -119,7 +120,7 @@ Item { pointSize: (isVertical ? pillContainer.pillWidth : pillContainer.pillHeight) * textRatio applyUiScale: false font.capitalization: Font.AllUppercase - font.weight: Style.fontWeightBold + font.weight: fontWeight horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Text.Wrap diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index d1003da2b..381c689f5 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -44,6 +44,20 @@ Item { readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode readonly property bool hasLabel: (labelMode !== "none") + readonly property string fontWeight: { + var fontWeightSetting = (widgetSettings.fontWeight !== undefined) ? + widgetSettings.fontWeight : widgetMetadata.fontWeight; + + if (fontWeightSetting === "regular") + return Style.fontWeightRegular; + if (fontWeightSetting === "medium") + return Style.fontWeightMedium; + if (fontWeightSetting === "semibold") + return Style.fontWeightSemiBold; + if (fontWeightSetting === "bold") + return Style.fontWeightBold; + return Style.fontWeightBold; + } 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) @@ -555,6 +569,7 @@ Item { capsuleHeight: root.capsuleHeight barHeight: root.barHeight labelMode: root.labelMode + fontWeight: root.fontWeight characterCount: root.characterCount textRatio: root.textRatio showLabelsOnlyWhenOccupied: root.showLabelsOnlyWhenOccupied @@ -589,6 +604,7 @@ Item { capsuleHeight: root.capsuleHeight barHeight: root.barHeight labelMode: root.labelMode + fontWeight: root.fontWeight characterCount: root.characterCount textRatio: root.textRatio showLabelsOnlyWhenOccupied: root.showLabelsOnlyWhenOccupied @@ -853,7 +869,7 @@ Item { family: Settings.data.ui.fontFixed font { pointSize: barFontSize * 0.75 - weight: Style.fontWeightBold + weight: fontWeight capitalization: Font.AllUppercase } applyUiScale: false diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml index 6ef5b44f7..5a3ac254e 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/WorkspaceSettings.qml @@ -33,6 +33,7 @@ ColumnLayout { 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 + property string valueFontWeight: widgetData.fontWeight !== undefined ? widgetData.fontWeight : widgetMetadata.fontWeight function saveSettings() { var settings = Object.assign({}, widgetData || {}); @@ -52,6 +53,7 @@ ColumnLayout { settings.emptyColor = valueEmptyColor; settings.showBadge = valueShowBadge; settings.pillSize = valuePillSize; + settings.fontWeight = valueFontWeight; settingsChanged(settings); } @@ -115,6 +117,36 @@ ColumnLayout { visible: !valueShowApplications } + NComboBox { + id: fontWeightCombo + label: I18n.tr("bar.workspace.font-weight-label") + description: I18n.tr("bar.workspace.font-weight-description") + model: [ + { + "key": "regular", + "name": I18n.tr("common.font-weight-regular") + }, + { + "key": "medium", + "name": I18n.tr("common.font-weight-medium") + }, + { + "key": "semibold", + "name": I18n.tr("common.font-weight-semibold") + }, + { + "key": "bold", + "name": I18n.tr("common.font-weight-bold") + }, + ] + currentKey: widgetData.fontWeight || widgetMetadata.fontWeight + onSelected: key => { + valueFontWeight = key; + saveSettings(); + } + minimumWidth: 200 + } + NToggle { label: I18n.tr("bar.workspace.hide-unoccupied-label") description: I18n.tr("bar.workspace.hide-unoccupied-description") diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index aa00680d9..238d5f281 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -303,7 +303,8 @@ Singleton { "occupiedColor": "secondary", "emptyColor": "secondary", "showBadge": true, - "pillSize": 0.6 + "pillSize": 0.6, + "fontWeight": "bold" }, "Volume": { "displayMode": "onhover",