From 4c077e6e96474dd5cd3860fddbe5273b03cbb50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 11:00:30 -0700 Subject: [PATCH 01/14] DisplayWidget: use Granite.Symbol for volume icon --- data/24/volume.svg | 139 +++++++++++++++++++++++++++++++++ data/gresource.xml | 2 + meson.build | 1 + src/Indicator.vala | 25 ++++-- src/Widgets/DisplayWidget.vala | 16 ++-- src/Widgets/Symbol.vala | 78 ++++++++++++++++++ 6 files changed, 246 insertions(+), 15 deletions(-) create mode 100644 data/24/volume.svg create mode 100644 src/Widgets/Symbol.vala diff --git a/data/24/volume.svg b/data/24/volume.svg new file mode 100644 index 00000000..84f6c7cb --- /dev/null +++ b/data/24/volume.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/data/gresource.xml b/data/gresource.xml index 7ac75b32..40b513b1 100644 --- a/data/gresource.xml +++ b/data/gresource.xml @@ -2,6 +2,7 @@ indicator.css + 24/volume.svg 16/audio-subwoofer-symbolic.svg @@ -34,6 +35,7 @@ 24/muted-80.svg 24/muted-90.svg + 48/microphone.svg 48/muted.svg diff --git a/meson.build b/meson.build index 4d6843af..59e8fba6 100644 --- a/meson.build +++ b/meson.build @@ -52,6 +52,7 @@ shared_module( 'src/Widgets/PlayerList.vala', 'src/Widgets/DeviceManagerWidget.vala', 'src/Widgets/DeviceItem.vala', + 'src' / 'Widgets' / 'Symbol.vala', 'src/Services/PulseAudioManager.vala', 'src/Services/MprisClient.vala', 'src/Services/Volume-control.vala', diff --git a/src/Indicator.vala b/src/Indicator.vala index 86787edb..8a6c02d8 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -115,7 +115,7 @@ public class Sound.Indicator : Wingpanel.Indicator { display_widget.volume_press_event.connect (volume_control.toggle_mute); display_widget.mic_press_event.connect (volume_control.toggle_mic_mute); - display_widget.icon_name = get_volume_icon (volume_control.volume.volume); + display_widget.volume_state = get_volume_state (volume_control.volume.volume); display_widget.volume_scroll_event.connect_after (on_volume_icon_scroll_event); display_widget.mic_scroll_event.connect_after (on_mic_icon_scroll_event); @@ -268,7 +268,7 @@ public class Sound.Indicator : Wingpanel.Indicator { double volume = volume_control.volume.volume / max_volume; if (volume != volume_adjustment.get_value ()) { volume_adjustment.set_value (volume); - display_widget.icon_name = get_volume_icon (volume); + display_widget.volume_state = get_volume_state (volume); } } @@ -283,13 +283,12 @@ public class Sound.Indicator : Wingpanel.Indicator { private void on_mute_change () { volume_scale.active = !volume_control.mute; - string volume_icon = get_volume_icon (volume_control.volume.volume); - display_widget.icon_name = volume_icon; + display_widget.volume_state = get_volume_state (volume_control.volume.volume); if (volume_control.mute) { volume_scale.icon = "audio-volume-muted-symbolic"; } else { - volume_scale.icon = volume_icon; + volume_scale.icon = get_volume_icon (volume_control.volume.volume); } } @@ -320,12 +319,12 @@ public class Sound.Indicator : Wingpanel.Indicator { sound_was_blocked_timeout_id = Timeout.add_seconds (5, () => { mute_blocks_sound = false; sound_was_blocked_timeout_id = 0; - display_widget.icon_name = get_volume_icon (volume_control.volume.volume); + display_widget.volume_state = get_volume_state (volume_control.volume.volume); return false; }); } - display_widget.icon_name = get_volume_icon (volume_control.volume.volume); + display_widget.volume_state = get_volume_state (volume_control.volume.volume); } private void on_volume_icon_scroll_event (Value event_value) { @@ -356,6 +355,18 @@ public class Sound.Indicator : Wingpanel.Indicator { } } + private unowned string get_volume_state (double volume) { + if (volume <= 0 || this.volume_control.mute) { + return this.mute_blocks_sound ? "disabled-blocking" : Granite.SymbolState.DISABLED; + } else if (volume <= 0.3) { + return "low"; + } else if (volume <= 0.7) { + return Granite.SymbolState.NORMAL; + } else { + return "high"; + } + } + private void on_volume_switch_change () { if (volume_scale.active) { volume_control.set_mute (false); diff --git a/src/Widgets/DisplayWidget.vala b/src/Widgets/DisplayWidget.vala index 56c13a46..662b8917 100644 --- a/src/Widgets/DisplayWidget.vala +++ b/src/Widgets/DisplayWidget.vala @@ -21,7 +21,7 @@ public class Sound.DisplayWidget : Gtk.Box { public bool show_mic { get; set; } public bool mic_muted { get; set; } - public string icon_name { get; set; } + public string volume_state { get; set; } // HACK: Using Gdk.ScrollEvent instead of Value as the type of the parameter // resulsts build error with valac 0.56.18 @@ -30,7 +30,7 @@ public class Sound.DisplayWidget : Gtk.Box { public signal void mic_scroll_event (Value event_value); construct { - var volume_icon = new Gtk.Image () { + var volume_symbol = new Granite.Symbol ("/io/elementary/wingpanel/sound/24/volume.svg") { pixel_size = 24 }; @@ -45,7 +45,7 @@ public class Sound.DisplayWidget : Gtk.Box { valign = Gtk.Align.CENTER; append (mic_revealer); - append (volume_icon); + append (volume_symbol); var mic_scroll_controller = new Gtk.EventControllerLegacy (); mic_scroll_controller.event.connect ((e) => { @@ -72,7 +72,7 @@ public class Sound.DisplayWidget : Gtk.Box { }); mic_icon.add_controller (mic_scroll_controller); - volume_icon.add_controller (volume_scroll_controller); + volume_symbol.add_controller (volume_scroll_controller); var mic_gesture_click = new Gtk.GestureClick () { button = Gdk.BUTTON_MIDDLE @@ -94,12 +94,12 @@ public class Sound.DisplayWidget : Gtk.Box { volume_gesture_click.reset (); }); - volume_icon.add_controller (volume_gesture_click); + volume_symbol.add_controller (volume_gesture_click); bind_property ( - "icon-name", - volume_icon, - "icon-name", + "volume-state", + volume_symbol, + "state", GLib.BindingFlags.BIDIRECTIONAL | GLib.BindingFlags.SYNC_CREATE ); bind_property ( diff --git a/src/Widgets/Symbol.vala b/src/Widgets/Symbol.vala new file mode 100644 index 00000000..dbc77b5e --- /dev/null +++ b/src/Widgets/Symbol.vala @@ -0,0 +1,78 @@ +/* +* SPDX-License-Identifier: LGPL-2.1-or-later +* SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io) +*/ + +namespace Granite.SymbolState { + // The default state + public const string NORMAL = "normal"; + // Disabled state represented by a slash + public const string DISABLED = "disabled"; + // e.g. paired, connected, needs attention + public const string ACTIVE = "active"; +} + +public class Granite.Symbol : Granite.Bin { + public string resource_path { get; construct; } + + public int pixel_size { + get { return image.pixel_size; } + set { image.pixel_size = value; } + } + + public uint state_index { + get { return svg.state; } + set { + uint length = -1; + svg.get_state_names (out length); + + if (value > length - 1) { + warning ("Granite.Symbol set to undefined state. Ignoring."); + return; + } + + svg.state = value; + notify_property ("state"); + } + } + + public string state { + get { + uint length = -1; + return svg.get_state_names (out length)[state_index]; + } + set { + uint length = -1; + var names = svg.get_state_names (out length); + + for (int i = 0; i < length; i++) { + if (names[i] == value) { + state_index = i; + return; + } + } + + warning ("Granite.Symbol set to undefined state. Ignoring."); + } + } + + private Gtk.Image image; + private Gtk.Svg svg; + + public Symbol (string resource_path) { + Object (resource_path: resource_path); + } + + construct { + svg = new Gtk.Svg.from_resource (resource_path); + + image = new Gtk.Image.from_paintable (svg); + + child = image; + + child.realize.connect (() => { + svg.set_frame_clock (get_frame_clock ()); + svg.play (); + }); + } +} From 04521bb046d779575a822666318fe0bdbbde7c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 11:51:10 -0700 Subject: [PATCH 02/14] Clean up SVG a bit --- data/24/volume.svg | 59 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index 84f6c7cb..d511ecff 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -5,6 +5,7 @@ gpa:version='1' gpa:state-names='low normal high disabled disabled-blocking' gpa:state='0' + id='svg1' width='24' height='24'> Date: Wed, 19 Aug 2026 12:32:35 -0700 Subject: [PATCH 03/14] don't fade blocking --- data/24/volume.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index d511ecff..6e192d55 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -159,7 +159,7 @@ ry='1' gpa:stroke-minwidth='25%' gpa:stroke-maxwidth='150%' - gpa:states='disabled disabled-blocking' + gpa:states='disabled' gpa:transition-type='fade' gpa:transition-easing='ease-in-out' gpa:transition-duration='200ms'> From fc1ac8ac25da1bab9f5e3b8542e2bf97780f16b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 13:17:36 -0700 Subject: [PATCH 04/14] Fix blocking color --- data/24/volume.svg | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/data/24/volume.svg b/data/24/volume.svg index 6e192d55..923586a8 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -18,6 +18,18 @@ d='M 9 6 C 8.73855 6, 8.50204 6.10053, 8.32422 6.26367 L 5.00002 8.99997 L 3.00002 8.99997 C 2.44602 8.99997, 2.00002 9.44597, 2.00002 9.99997 L 2.00002 14 C 2.00002 14.554, 2.44602 15, 3.00002 15 L 5.00002 15 L 8.34572 17.7539 C 8.35201 17.7594, 8.35688 17.7662, 8.3633 17.7715 L 8.38674 17.7891 C 8.55597 17.9205, 8.7682 18, 9.00002 18 C 9.55402 18, 10 17.554, 10 17 L 10 6.99997 C 10 6.44597, 9.55402 5.99997, 9.00002 5.99997 Z' gpa:animation-repeat='0' gpa:animation-segment='0'> + + Date: Wed, 19 Aug 2026 13:20:11 -0700 Subject: [PATCH 05/14] Improve blocking color animation --- data/24/volume.svg | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index 923586a8..cd16e587 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -30,6 +30,18 @@ to='url(#gpa:foreground) rgb(0,0,0)' dur='200ms' fill='freeze'/> + + - - From a9dbd27d49101078393f744cda5ceb35448b94f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 13:48:22 -0700 Subject: [PATCH 06/14] Add transform, let shaper clean up --- data/24/volume.svg | 52 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index cd16e587..8056062b 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -10,7 +10,6 @@ height='24'> - - + - + - + + + + fill='freeze' + from='0 0' + to='5 0' + keyTimes='0; 1' + type='translate'/> Date: Wed, 19 Aug 2026 14:04:58 -0700 Subject: [PATCH 07/14] All translates --- data/24/volume.svg | 456 +++++++++++++++++++++++++++------------------ 1 file changed, 276 insertions(+), 180 deletions(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index 8056062b..779bc4dc 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -1,187 +1,283 @@ + - - - - - - - - - - - - - - + gpa:version="1" + gpa:state-names="low normal high disabled disabled-blocking" + gpa:state="2" + id="svg1" + width="24" + height="24" + version="1.1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:gpa="https://www.gtk.org/grappa"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + id="slash" + display="inline" + visibility="hidden" + fill="none" + stroke="url(#gpa:foreground) rgb(0,0,0)" + stroke-opacity="1" + stroke-width="1.25" + stroke-linecap="round" + stroke-linejoin="round" + stroke-miterlimit="4" + x1="6.045" + y1="5.42123" + x2="19.2458" + y2="18.6085" + gpa:stroke-minwidth="25%" + gpa:stroke-maxwidth="200%" + gpa:states="disabled disabled-blocking" + gpa:transition-type="animate" + gpa:transition-easing="ease-in-out" + gpa:transition-duration="200ms" /> + id="disabled-mask" + opacity="1"> - + id="bg" + fill="rgb(255,255,255)" + x="0" + y="0" + width="100%" + height="100%" /> - + id="slash-clip" + visibility="hidden" + clip-path="url(#clipPath1)" + stroke="rgb(0,0,0)" + stroke-opacity="1" + stroke-width="1.25" + stroke-linecap="round" + stroke-linejoin="round" + stroke-miterlimit="4" + x1="6.045" + y1="7.045" + x2="19.2458" + y2="20.23" + gpa:stroke-minwidth="25%" + gpa:stroke-maxwidth="200%" + gpa:states="disabled disabled-blocking" + gpa:transition-type="animate" + gpa:transition-easing="ease-in-out" + gpa:transition-duration="200ms" /> From 05bee791306dc44f03a34d13c505d629f86214c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 14:07:23 -0700 Subject: [PATCH 08/14] fix mask transform --- data/24/volume.svg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index 779bc4dc..68368f79 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -12,6 +12,7 @@ xmlns:gpa="https://www.gtk.org/grappa"> + + Date: Wed, 19 Aug 2026 14:09:10 -0700 Subject: [PATCH 09/14] let shaper clean up --- data/24/volume.svg | 532 +++++++++++++++++++++++---------------------- 1 file changed, 271 insertions(+), 261 deletions(-) diff --git a/data/24/volume.svg b/data/24/volume.svg index 68368f79..6d3135c0 100644 --- a/data/24/volume.svg +++ b/data/24/volume.svg @@ -1,284 +1,294 @@ - - - + xmlns='http://www.w3.org/2000/svg' + xmlns:svg='http://www.w3.org/2000/svg' + xmlns:gpa='https://www.gtk.org/grappa' + gpa:version='1' + gpa:state-names='low normal high disabled disabled-blocking' + gpa:state='2' + id='svg1' + width='24' + height='24'> + id='mask-group' + mask='url(#disabled-mask)'> + + attributeName='opacity' + begin='gpa:states(low normal high disabled-blocking, disabled)' + dur='200ms' + fill='freeze' + to='0.5' + keyTimes='0; 1'/> - - + attributeName='opacity' + begin='gpa:states(disabled, low normal high disabled-blocking)' + dur='200ms' + fill='freeze' + to='1' + keyTimes='0; 1'/> + attributeName='transform' + begin='gpa:states(low, normal)' + dur='200ms' + fill='freeze' + from='4 0' + to='2 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(low, high)' + dur='200ms' + fill='freeze' + from='4 0' + to='0 0' + keyTimes='0; 1' + type='translate'/> - + attributeName='transform' + begin='gpa:states(low, disabled disabled-blocking)' + dur='200ms' + fill='freeze' + from='4 0' + to='5 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(normal, low)' + dur='200ms' + fill='freeze' + from='2 0' + to='4 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(normal, high)' + dur='200ms' + fill='freeze' + from='2 0' + to='0 0' + keyTimes='0; 1' + type='translate'/> - + attributeName='transform' + begin='gpa:states(normal, disabled disabled-blocking)' + dur='200ms' + fill='freeze' + from='2 0' + to='5 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(high, low)' + dur='200ms' + fill='freeze' + from='0 0' + to='4 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(high, normal)' + dur='200ms' + fill='freeze' + from='0 0' + to='2 0' + keyTimes='0; 1' + type='translate'/> - + attributeName='transform' + begin='gpa:states(high, disabled disabled-blocking)' + dur='200ms' + fill='freeze' + from='0 0' + to='5 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(disabled disabled-blocking, low)' + dur='200ms' + fill='freeze' + from='5 0' + to='4 0' + keyTimes='0; 1' + type='translate'/> + attributeName='transform' + begin='gpa:states(disabled disabled-blocking, normal)' + dur='200ms' + fill='freeze' + from='5 0' + to='2 0' + keyTimes='0; 1' + type='translate'/> - - - - - - - - + attributeName='transform' + begin='gpa:states(disabled disabled-blocking, high)' + dur='200ms' + fill='freeze' + from='5 0' + to='0 0' + keyTimes='0; 1' + type='translate'/> + + + + + + + + + + + + id='slash' + display='inline' + visibility='hidden' + transform='none' + fill='none' + stroke='url(#gpa:foreground) rgb(0,0,0)' + stroke-opacity='1' + stroke-width='1.25' + stroke-linecap='round' + stroke-linejoin='round' + stroke-miterlimit='4' + x1='6.045' + y1='5.42123' + x2='19.2458' + y2='18.6085' + gpa:stroke-minwidth='25%' + gpa:stroke-maxwidth='200%' + class='transparent-fill foreground-stroke' + gpa:stroke='foreground' + gpa:states='disabled disabled-blocking' + gpa:transition-type='animate' + gpa:transition-easing='ease-in-out' + gpa:transition-duration='200ms'> + + id='disabled-mask' + opacity='1'> + id='bg' + fill='rgb(255,255,255)' + x='0' + y='0' + width='100%' + height='100%'> + + id='slash-clip' + visibility='hidden' + clip-path='url(#clipPath1)' + stroke='rgb(0,0,0)' + stroke-opacity='1' + stroke-width='1.25' + stroke-linecap='round' + stroke-linejoin='round' + stroke-miterlimit='4' + x1='6.045' + y1='7.045' + x2='19.2458' + y2='20.23' + gpa:stroke-minwidth='25%' + gpa:stroke-maxwidth='200%' + gpa:states='disabled disabled-blocking' + gpa:transition-type='animate' + gpa:transition-easing='ease-in-out' + gpa:transition-duration='200ms'> + From d2f0f2a3d3e9901dda631f74548eb75afc9f4e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 18:40:09 -0700 Subject: [PATCH 10/14] Update gresource.xml --- data/gresource.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/data/gresource.xml b/data/gresource.xml index 40b513b1..7c94c131 100644 --- a/data/gresource.xml +++ b/data/gresource.xml @@ -35,7 +35,6 @@ 24/muted-80.svg 24/muted-90.svg - 48/microphone.svg 48/muted.svg From 964d9d35defa3ad757dc00106f06b38f55252782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 18:41:11 -0700 Subject: [PATCH 11/14] Update Indicator.vala --- src/Indicator.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index 8a6c02d8..911c08bb 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -115,7 +115,7 @@ public class Sound.Indicator : Wingpanel.Indicator { display_widget.volume_press_event.connect (volume_control.toggle_mute); display_widget.mic_press_event.connect (volume_control.toggle_mic_mute); - display_widget.volume_state = get_volume_state (volume_control.volume.volume); + display_widget.volume_state = get_volume_state (volume_control.volume.volume); display_widget.volume_scroll_event.connect_after (on_volume_icon_scroll_event); display_widget.mic_scroll_event.connect_after (on_mic_icon_scroll_event); @@ -268,7 +268,7 @@ public class Sound.Indicator : Wingpanel.Indicator { double volume = volume_control.volume.volume / max_volume; if (volume != volume_adjustment.get_value ()) { volume_adjustment.set_value (volume); - display_widget.volume_state = get_volume_state (volume); + display_widget.volume_state = get_volume_state (volume); } } @@ -319,7 +319,7 @@ public class Sound.Indicator : Wingpanel.Indicator { sound_was_blocked_timeout_id = Timeout.add_seconds (5, () => { mute_blocks_sound = false; sound_was_blocked_timeout_id = 0; - display_widget.volume_state = get_volume_state (volume_control.volume.volume); + display_widget.volume_state = get_volume_state (volume_control.volume.volume); return false; }); } From f6fc9dd688196f89f51f7d2e7f0d546029648fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 19 Aug 2026 18:42:24 -0700 Subject: [PATCH 12/14] Update Indicator.vala --- src/Indicator.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index 911c08bb..42d7efd9 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -324,7 +324,7 @@ public class Sound.Indicator : Wingpanel.Indicator { }); } - display_widget.volume_state = get_volume_state (volume_control.volume.volume); + display_widget.volume_state = get_volume_state (volume_control.volume.volume); } private void on_volume_icon_scroll_event (Value event_value) { From 08951e4cff5e9fadba188d154b6376942b471074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 25 Aug 2026 21:24:09 -0700 Subject: [PATCH 13/14] Update namespace --- src/Indicator.vala | 4 ++-- src/Widgets/DisplayWidget.vala | 2 +- src/Widgets/Symbol.vala | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index 42d7efd9..e75bbe2a 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -357,11 +357,11 @@ public class Sound.Indicator : Wingpanel.Indicator { private unowned string get_volume_state (double volume) { if (volume <= 0 || this.volume_control.mute) { - return this.mute_blocks_sound ? "disabled-blocking" : Granite.SymbolState.DISABLED; + return this.mute_blocks_sound ? "disabled-blocking" : SoundIndicator.SymbolState.DISABLED; } else if (volume <= 0.3) { return "low"; } else if (volume <= 0.7) { - return Granite.SymbolState.NORMAL; + return SoundIndicator.SymbolState.NORMAL; } else { return "high"; } diff --git a/src/Widgets/DisplayWidget.vala b/src/Widgets/DisplayWidget.vala index 662b8917..10fe18f2 100644 --- a/src/Widgets/DisplayWidget.vala +++ b/src/Widgets/DisplayWidget.vala @@ -30,7 +30,7 @@ public class Sound.DisplayWidget : Gtk.Box { public signal void mic_scroll_event (Value event_value); construct { - var volume_symbol = new Granite.Symbol ("/io/elementary/wingpanel/sound/24/volume.svg") { + var volume_symbol = new SoundIndicator.Symbol ("/io/elementary/wingpanel/sound/24/volume.svg") { pixel_size = 24 }; diff --git a/src/Widgets/Symbol.vala b/src/Widgets/Symbol.vala index dbc77b5e..e131bc57 100644 --- a/src/Widgets/Symbol.vala +++ b/src/Widgets/Symbol.vala @@ -3,7 +3,7 @@ * SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io) */ -namespace Granite.SymbolState { +namespace SoundIndicator.SymbolState { // The default state public const string NORMAL = "normal"; // Disabled state represented by a slash @@ -12,7 +12,7 @@ namespace Granite.SymbolState { public const string ACTIVE = "active"; } -public class Granite.Symbol : Granite.Bin { +public class SoundIndicator.Symbol : Granite.Bin { public string resource_path { get; construct; } public int pixel_size { From ef33cb399fe189a3e7121475557c14367476ccda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 25 Aug 2026 21:27:13 -0700 Subject: [PATCH 14/14] bump GTK requirement --- README.md | 2 +- meson.build | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c262485..63749db9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ You'll need the following dependencies: libgranite-7-dev >= 7.7.0 libglib2.0-dev - libgtk-4-dev + libgtk-4-dev >= 4.22 libnotify-dev libpulse-dev libwingpanel-9-dev diff --git a/meson.build b/meson.build index 72dddcf9..170b55c2 100644 --- a/meson.build +++ b/meson.build @@ -52,7 +52,7 @@ shared_module( 'src/Widgets/PlayerList.vala', 'src/Widgets/DeviceManagerWidget.vala', 'src/Widgets/DeviceItem.vala', - 'src' / 'Widgets' / 'Symbol.vala', + 'src/Widgets/Symbol.vala', 'src/Services/PulseAudioManager.vala', 'src/Services/MprisClient.vala', 'src/Services/Volume-control.vala', @@ -66,7 +66,7 @@ shared_module( dependency('gio-2.0'), dependency('gobject-2.0'), dependency('granite-7', version: '>=7.7.0'), - dependency('gtk4'), + dependency('gtk4', version: '>=4.22'), dependency('gtk4-wayland'), dependency('gtk4-x11'), dependency('libpulse'),