Skip to content

Commit 174a006

Browse files
committed
feat(taskbar): Fix UWP icons and add title label configuration options
- Introduced a new `title_label` setting in the taskbar widget. - Allows enabling/disabling title labels and configuring their display behavior. - Fixed UWP icons to ensure they are displayed correctly in the taskbar.
1 parent 393054d commit 174a006

File tree

3 files changed

+291
-93
lines changed

3 files changed

+291
-93
lines changed

docs/widgets/(Widget)-Taskbar.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| `icon_size` | integer | 16 | The size of icons |
55
| `ignore_apps` | dict | `processes:[],titles[],classes:[]` | Ignore some apps. |
66
| `tooltip` | boolean | `True` | Whether to show the tooltip on hover. |
7+
| `title_label` | dict | `{'enabled': False, 'show': 'focused', 'min_length': 10, 'max_length': 30}` | Title label configuration for displaying window titles. |
78
| `container_padding` | dict | `{'top': 0, 'left': 0, 'bottom': 0, 'right': 0}` | Explicitly set padding inside widget container.
89
| `callbacks` | dict | `{'on_left': 'toggle_window', 'on_middle': 'do_nothing', 'on_right': 'do_nothing'}` | Callbacks for mouse events on the widget. |
910
| `animation` | dict | `{'enabled': True, 'type': 'fadeInOut', 'duration': 200}` | Animation settings for the widget. |
@@ -19,6 +20,11 @@ taskbar:
1920
enabled: true
2021
duration: 200
2122
type: "fadeInOut"
23+
title_label:
24+
enabled: false
25+
show: "focused"
26+
min_length: 10
27+
max_length: 30
2228
ignore_apps:
2329
processes: []
2430
titles: []
@@ -34,6 +40,11 @@ taskbar:
3440
3541
- **icon_size:** The size of icons which will show in the widget.
3642
- **tooltip:** Whether to show the tooltip on hover.
43+
- **title_label:** A dictionary specifying the configuration for window title labels. It includes:
44+
- enabled: A boolean flag to enable or disable title labels.
45+
- show: A string that determines the display behavior (either "focused" or "always").
46+
- min_length: The minimum length of the title label.
47+
- max_length: The maximum length of the title label.
3748
- **container_padding:** Explicitly set padding inside widget container.
3849
- **ignore_apps:** A dictionary that allows you to specify which applications should be ignored by the taskbar widget. It includes:
3950
- processes: A list of process names to ignore.
@@ -54,7 +65,10 @@ taskbar:
5465
.taskbar-widget .app-icon.foreground{
5566
background-color: rgba(0, 0, 0, 0.4);
5667
}
68+
/* if title_label is enabled: */
69+
.taskbar-widget .app-title {}
70+
.taskbar-widget .app-title.foreground {}
5771
```
5872

5973
> [!IMPORTANT]
60-
> Taskbar apps will work only if they are minimized so that YASB can restore them on click; if you close the app to go in the system tray, YASB can't work in that way.
74+
> The title label is disabled by default. If you decide to enable it, keep in mind that it may result in slightly higher CPU usage.

src/core/validation/widgets/yasb/taskbar.py

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
DEFAULTS = {
22
'icon_size': 16,
3-
'tooltip': True,
3+
'tooltip': False,
44
'ignore_apps': {
55
'classes': [],
66
'processes': [],
@@ -11,6 +11,12 @@
1111
'type': 'fadeInOut',
1212
'duration': 200
1313
},
14+
'title_label': {
15+
'enabled': False,
16+
'show': 'focused',
17+
'min_length': 10,
18+
'max_length': 30
19+
},
1420
'container_padding': {'top': 0, 'left': 0, 'bottom': 0, 'right': 0},
1521
'callbacks': {
1622
'on_left': 'toggle_window',
@@ -56,6 +62,29 @@
5662
},
5763
'default': DEFAULTS['ignore_apps']
5864
},
65+
'title_label': {
66+
'type': 'dict',
67+
'schema': {
68+
'enabled': {
69+
'type': 'boolean',
70+
'default': DEFAULTS['title_label']['enabled']
71+
},
72+
'show': {
73+
'type': 'string',
74+
'allowed': ['focused', 'always'],
75+
'default': DEFAULTS['title_label']['show']
76+
},
77+
'min_length': {
78+
'type': 'integer',
79+
'default': DEFAULTS['title_label']['min_length']
80+
},
81+
'max_length': {
82+
'type': 'integer',
83+
'default': DEFAULTS['title_label']['max_length']
84+
}
85+
},
86+
'default': DEFAULTS['title_label']
87+
},
5988
'animation': {
6089
'type': ['dict', 'boolean'],
6190
'required': False,

0 commit comments

Comments
 (0)