Skip to content

Commit f26fa7c

Browse files
committed
Moved Volume widget icon sizes to CSS
1 parent f7fe5ed commit f26fa7c

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

data/style/widgets/volume.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:root {
2+
--widget-volume-row-icon-size: 24px;
3+
}
4+
15
.widget-volume {
26
padding: $margin;
37
margin: $margin;
@@ -7,6 +11,11 @@
711
.widget-volume > box > button {
812
}
913

14+
/* Each row app icon */
15+
.widget-volume row image {
16+
-gtk-icon-size: var(--widget-volume-row-icon-size);
17+
}
18+
1019
.per-app-volume {
1120
background-color: var(--noti-bg-alt);
1221
padding: $margin/2 $margin $margin $margin;

src/configSchema.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,9 @@
557557
},
558558
"icon-size": {
559559
"type": "integer",
560-
"default": 24,
561-
"description": "Size of the application icon in per app volume control"
560+
"deprecated": true,
561+
"default": -1,
562+
"description": "deprecated (change the CSS root variable \"--widget-volume-row-icon-size\"): Size of the application icon in per app volume control"
562563
},
563564
"animation-type": {
564565
"type": "string",

src/controlCenter/widgets/volume/sinkInputRow.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace SwayNotificationCenter.Widgets {
2626
scale.draw_value = false;
2727
scale.set_hexpand (true);
2828

29-
icon.pixel_size = icon_size;
29+
icon.set_pixel_size (icon_size);
3030

3131
container = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
3232

src/controlCenter/widgets/volume/volume.vala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ namespace SwayNotificationCenter.Widgets {
2020

2121
string ? expand_label = null;
2222
string ? collapse_label = null;
23-
int icon_size = 24;
23+
24+
[Version (deprecated = true, replacement = "CSS root variable")]
25+
int icon_size = -1;
2426

2527
Gtk.RevealerTransitionType revealer_type = Gtk.RevealerTransitionType.SLIDE_DOWN;
2628
int revealer_duration = 250;
@@ -124,8 +126,8 @@ namespace SwayNotificationCenter.Widgets {
124126

125127
foreach (var item in this.client.active_sinks.values) {
126128
SinkInputRow row = new SinkInputRow (item, client,
127-
icon_size, show_per_app_icon,
128-
show_per_app_label);
129+
icon_size, show_per_app_icon,
130+
show_per_app_label);
129131
list_box_controller.append (row);
130132
}
131133

0 commit comments

Comments
 (0)