Merge pull request #1155 from GravityShark/workspace-color

Workspace: readd opacity property for appicons
This commit is contained in:
Lemmy
2025-12-28 14:30:35 -05:00
committed by GitHub
4 changed files with 27 additions and 0 deletions
+4
View File
@@ -433,6 +433,10 @@
"description": "Choose how workspace labels are displayed.",
"label": "Label mode"
},
"unfocused-icons-opacity": {
"description": "Set the opacity level for unfocused app icons",
"label": "Unfocused icons opacity"
},
"show-applications": {
"description": "Display application icons inside each workspace.",
"label": "Show applications"
+2
View File
@@ -54,6 +54,7 @@ Item {
readonly property bool showApplications: (widgetSettings.showApplications !== undefined) ? widgetSettings.showApplications : widgetMetadata.showApplications
readonly property bool showLabelsOnlyWhenOccupied: (widgetSettings.showLabelsOnlyWhenOccupied !== undefined) ? widgetSettings.showLabelsOnlyWhenOccupied : widgetMetadata.showLabelsOnlyWhenOccupied
readonly property bool colorizeIcons: (widgetSettings.colorizeIcons !== undefined) ? widgetSettings.colorizeIcons : widgetMetadata.colorizeIcons
readonly property real unfocusedIconsOpacity: (widgetSettings.unfocusedIconsOpacity !== undefined) ? widgetSettings.unfocusedIconsOpacity : widgetMetadata.unfocusedIconsOpacity
readonly property bool enableScrollWheel: (widgetSettings.enableScrollWheel !== undefined) ? widgetSettings.enableScrollWheel : widgetMetadata.enableScrollWheel
readonly property int itemSize: Math.round(Style.capsuleHeight * 0.8)
@@ -833,6 +834,7 @@ Item {
source: ThemeIcons.iconForAppId(model.appId)
smooth: true
asynchronous: true
opacity: model.isFocused ? Style.opacityFull : unfocusedIconsOpacity
layer.enabled: root.colorizeIcons && !model.isFocused
Rectangle {
@@ -21,6 +21,7 @@ ColumnLayout {
property bool valueShowApplications: widgetData.showApplications !== undefined ? widgetData.showApplications : widgetMetadata.showApplications
property bool valueShowLabelsOnlyWhenOccupied: widgetData.showLabelsOnlyWhenOccupied !== undefined ? widgetData.showLabelsOnlyWhenOccupied : widgetMetadata.showLabelsOnlyWhenOccupied
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : widgetMetadata.colorizeIcons
property real valueUnfocusedIconsOpacity: widgetData.unfocusedIconsOpacity !== undefined ? widgetData.unfocusedIconsOpacity : widgetMetadata.unfocusedIconsOpacity
property bool valueEnableScrollWheel: widgetData.enableScrollWheel !== undefined ? widgetData.enableScrollWheel : widgetMetadata.enableScrollWheel
function saveSettings() {
@@ -32,6 +33,7 @@ ColumnLayout {
settings.showApplications = valueShowApplications;
settings.showLabelsOnlyWhenOccupied = valueShowLabelsOnlyWhenOccupied;
settings.colorizeIcons = valueColorizeIcons;
settings.unfocusedIconsOpacity = valueUnfocusedIconsOpacity;
settings.enableScrollWheel = valueEnableScrollWheel;
return settings;
}
@@ -115,4 +117,22 @@ ColumnLayout {
onToggled: checked => valueColorizeIcons = checked
visible: valueShowApplications
}
RowLayout {
spacing: Style.marginL
Layout.fillWidth: true
NLabel {
label: I18n.tr("bar.widget-settings.workspace.unfocused-icons-opacity.label")
description: I18n.tr("bar.widget-settings.workspace.unfocused-icons-opacity.description")
}
NValueSlider {
Layout.fillWidth: true
from: 0
to: 1
stepSize: 0.01
value: valueUnfocusedIconsOpacity
visible: valueShowApplications
onMoved: value => valueUnfocusedIconsOpacity = value
text: Math.floor(valueUnfocusedIconsOpacity * 100) + "%"
}
}
}
+1
View File
@@ -222,6 +222,7 @@ Singleton {
"showApplications": false,
"showLabelsOnlyWhenOccupied": true,
"colorizeIcons": false,
"unfocusedIconsOpacity": 1.0,
"enableScrollWheel": true
},
"Volume": {