From c2d2bc29f91dd8009d06e11c50b8fb3faf14e5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 18 Aug 2026 17:38:53 -0700 Subject: [PATCH 1/7] DisplayWidget: animate with Granite.Symbol --- data/gresource.xml | 31 +------------ data/icons/active.svg | 23 ---------- data/icons/bluetooth.svg | 82 ++++++++++++++++++++++++++++++++++ data/icons/disabled-10.svg | 28 ------------ data/icons/disabled-20.svg | 28 ------------ data/icons/disabled-30.svg | 25 ----------- data/icons/disabled-40.svg | 25 ----------- data/icons/disabled-50.svg | 25 ----------- data/icons/disabled-60.svg | 25 ----------- data/icons/disabled-70.svg | 25 ----------- data/icons/disabled-80.svg | 35 --------------- data/icons/disabled-90.svg | 35 --------------- data/icons/disabled.svg | 25 ----------- data/icons/paired.svg | 19 -------- data/indicator.css | 50 --------------------- meson.build | 1 + src/Widgets/DisplayWidget.vala | 28 ++++-------- src/Widgets/Symbol.vala | 42 +++++++++++++++++ 18 files changed, 134 insertions(+), 418 deletions(-) delete mode 100644 data/icons/active.svg create mode 100644 data/icons/bluetooth.svg delete mode 100644 data/icons/disabled-10.svg delete mode 100644 data/icons/disabled-20.svg delete mode 100644 data/icons/disabled-30.svg delete mode 100644 data/icons/disabled-40.svg delete mode 100644 data/icons/disabled-50.svg delete mode 100644 data/icons/disabled-60.svg delete mode 100644 data/icons/disabled-70.svg delete mode 100644 data/icons/disabled-80.svg delete mode 100644 data/icons/disabled-90.svg delete mode 100644 data/icons/disabled.svg delete mode 100644 data/icons/paired.svg delete mode 100644 data/indicator.css create mode 100644 src/Widgets/Symbol.vala diff --git a/data/gresource.xml b/data/gresource.xml index a6a0c06a..4433612c 100644 --- a/data/gresource.xml +++ b/data/gresource.xml @@ -1,35 +1,6 @@ - indicator.css - - - icons/active.svg - icons/disabled.svg - icons/paired.svg - - icons/disabled-10.svg - icons/disabled-20.svg - icons/disabled-30.svg - icons/disabled-40.svg - icons/disabled-50.svg - icons/disabled-60.svg - icons/disabled-70.svg - icons/disabled-80.svg - icons/disabled-90.svg - - icons/active.svg - icons/disabled.svg - icons/paired.svg - - icons/disabled-10.svg - icons/disabled-20.svg - icons/disabled-30.svg - icons/disabled-40.svg - icons/disabled-50.svg - icons/disabled-60.svg - icons/disabled-70.svg - icons/disabled-80.svg - icons/disabled-90.svg + icons/bluetooth.svg diff --git a/data/icons/active.svg b/data/icons/active.svg deleted file mode 100644 index c6a05fbb..00000000 --- a/data/icons/active.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/data/icons/bluetooth.svg b/data/icons/bluetooth.svg new file mode 100644 index 00000000..eb54d4bf --- /dev/null +++ b/data/icons/bluetooth.svg @@ -0,0 +1,82 @@ + + + + + + + + + + diff --git a/data/icons/disabled-10.svg b/data/icons/disabled-10.svg deleted file mode 100644 index e2b63b02..00000000 --- a/data/icons/disabled-10.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-20.svg b/data/icons/disabled-20.svg deleted file mode 100644 index 245d1343..00000000 --- a/data/icons/disabled-20.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-30.svg b/data/icons/disabled-30.svg deleted file mode 100644 index 07e96485..00000000 --- a/data/icons/disabled-30.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-40.svg b/data/icons/disabled-40.svg deleted file mode 100644 index f33f474e..00000000 --- a/data/icons/disabled-40.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-50.svg b/data/icons/disabled-50.svg deleted file mode 100644 index 2a85122f..00000000 --- a/data/icons/disabled-50.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-60.svg b/data/icons/disabled-60.svg deleted file mode 100644 index a43ed4e5..00000000 --- a/data/icons/disabled-60.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-70.svg b/data/icons/disabled-70.svg deleted file mode 100644 index b57f479f..00000000 --- a/data/icons/disabled-70.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/data/icons/disabled-80.svg b/data/icons/disabled-80.svg deleted file mode 100644 index 2bb7b89a..00000000 --- a/data/icons/disabled-80.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - diff --git a/data/icons/disabled-90.svg b/data/icons/disabled-90.svg deleted file mode 100644 index e2601b86..00000000 --- a/data/icons/disabled-90.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - diff --git a/data/icons/disabled.svg b/data/icons/disabled.svg deleted file mode 100644 index 76e74907..00000000 --- a/data/icons/disabled.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/data/icons/paired.svg b/data/icons/paired.svg deleted file mode 100644 index ac6b6a3c..00000000 --- a/data/icons/paired.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - diff --git a/data/indicator.css b/data/indicator.css deleted file mode 100644 index 0bdc8cc6..00000000 --- a/data/indicator.css +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright 2017 elementary, Inc. (https://elementary.io) -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public -* License as published by the Free Software Foundation; either -* version 2 of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -* Boston, MA 02110-1301 USA. -*/ - -.bluetooth-icon { - animation: none; - min-width: 24px; - opacity: 1; - transition: none; - -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-active-symbolic"); -} - -.bluetooth-icon.paired { - animation: none; - -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-paired-symbolic"); -} - -.bluetooth-icon.disabled { - animation: bluetooth-disabled 160ms cubic-bezier(0.4, 0.0, 0.2, 1); - -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-symbolic"); -} - -@keyframes bluetooth-disabled { - 0% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-active-symbolic"); } - 10% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-10-symbolic"); } - 20% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-20-symbolic"); } - 30% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-30-symbolic"); } - 40% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-40-symbolic"); } - 50% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-50-symbolic"); } - 60% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-60-symbolic"); } - 70% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-70-symbolic"); } - 80% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-80-symbolic"); } - 90% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-90-symbolic"); } - 100% { -gtk-icon-source: -gtk-icontheme("indicator-bluetooth-disabled-symbolic"); } -} diff --git a/meson.build b/meson.build index 837146f9..1851f7dc 100644 --- a/meson.build +++ b/meson.build @@ -47,6 +47,7 @@ shared_module( 'src/Widgets/Device.vala', 'src/Widgets/DisplayWidget.vala', 'src/Widgets/PopoverWidget.vala', + 'src' / 'Widgets' / 'Symbol.vala', config_file, gresource, dependencies: [ diff --git a/src/Widgets/DisplayWidget.vala b/src/Widgets/DisplayWidget.vala index 21ad3156..b14ede6e 100644 --- a/src/Widgets/DisplayWidget.vala +++ b/src/Widgets/DisplayWidget.vala @@ -6,28 +6,18 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Granite.Bin { public BluetoothIndicator.Services.ObjectManager object_manager { get; construct; } - private Gtk.Spinner spinner; + private Granite.Symbol symbol; public DisplayWidget (BluetoothIndicator.Services.ObjectManager object_manager) { Object (object_manager: object_manager); } construct { - spinner = new Gtk.Spinner (); - - child = spinner; - - // Prevent a race that skips automatic resource loading - // https://github.com/elementary/panel-bluetooth/issues/203 - Gtk.IconTheme.get_for_display (Gdk.Display.get_default ()).add_resource_path ("/org/elementary/wingpanel/icons"); - - var provider = new Gtk.CssProvider (); - provider.load_from_resource ("io/elementary/wingpanel/bluetooth/indicator.css"); - - Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); + symbol = new Granite.Symbol ("/io/elementary/wingpanel/bluetooth/icons/bluetooth.svg") { + pixel_size = 24 + }; - spinner.add_css_class ("bluetooth-icon"); - spinner.add_css_class ("disabled"); + child = symbol; object_manager.global_state_changed.connect ((state, connected) => { set_icon (); @@ -68,18 +58,16 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Granite.Bin { string context; if (state) { - spinner.remove_css_class ("disabled"); context = _("Middle-click to turn Bluetooth off"); if (connected) { - spinner.add_css_class ("paired"); + symbol.state = Granite.Symbol.STATE_CHECKED; description = _("Bluetooth connected"); } else { - spinner.remove_css_class ("paired"); + symbol.state = Granite.Symbol.STATE_NORMAL; description = _("Bluetooth is on"); } } else { - spinner.remove_css_class ("paired"); - spinner.add_css_class ("disabled"); + symbol.state = Granite.Symbol.STATE_DISABLED; description = _("Bluetooth is off"); context = _("Middle-click to turn Bluetooth on"); } diff --git a/src/Widgets/Symbol.vala b/src/Widgets/Symbol.vala new file mode 100644 index 00000000..30b0d624 --- /dev/null +++ b/src/Widgets/Symbol.vala @@ -0,0 +1,42 @@ +/* +* SPDX-License-Identifier: LGPL-2.1-or-later +* SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io) +*/ + +public class Granite.Symbol : Granite.Bin { + public const int STATE_NORMAL = 0; + public const int STATE_DISABLED = 1; + public const int STATE_CHECKED = 2; + + public string resource_path { get; construct; } + + public int pixel_size { + get { return image.pixel_size; } + set { image.pixel_size = value; } + } + + public uint state { + get { return svg.state; } + set { svg.state = value; } + } + + 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 93ad7de3163466d8f29cc1f3613d527dcc1c7df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 18 Aug 2026 18:07:28 -0700 Subject: [PATCH 2/7] Use masks --- data/icons/bluetooth.svg | 88 +++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 23 deletions(-) diff --git a/data/icons/bluetooth.svg b/data/icons/bluetooth.svg index eb54d4bf..271f6678 100644 --- a/data/icons/bluetooth.svg +++ b/data/icons/bluetooth.svg @@ -12,6 +12,7 @@ id='path2' class='' color='rgb(190,190,190)' + mask='url(#mask1)' fill='url(#gpa:foreground) rgb(0,0,0)' fill-opacity='1' fill-rule='nonzero' @@ -20,28 +21,6 @@ gpa:states='state0 state1 state2' gpa:animation-repeat='0' gpa:animation-segment='0'> - - + + + + + + + + From 3a4943fdb672b5c91bc8f64196458571aed2f21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 18 Aug 2026 18:18:41 -0700 Subject: [PATCH 3/7] Add minimum GTK version --- README.md | 1 + meson.build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a1d93aa..cabc3997 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ You'll need the following dependencies: gobject-introspection libglib2.0-dev + libgtk-4-dev >=4.22 libgranite-7-dev >= 7.0.0 libwingpanel-9-dev meson >= 0.58.0 diff --git a/meson.build b/meson.build index 1851f7dc..18b1da9a 100644 --- a/meson.build +++ b/meson.build @@ -54,7 +54,7 @@ shared_module( dependency('glib-2.0'), dependency('gobject-2.0'), dependency('granite-7', version: '>=7.0.0'), - dependency('gtk4'), + dependency('gtk4', version: '>=4.22'), wingpanel_dep ], install: true, From 597c8f5507b3cac1b053dd4c8f35ba66e998bdc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 18 Aug 2026 18:21:33 -0700 Subject: [PATCH 4/7] explicit colors --- data/icons/bluetooth.svg | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/data/icons/bluetooth.svg b/data/icons/bluetooth.svg index 271f6678..b79a7c6c 100644 --- a/data/icons/bluetooth.svg +++ b/data/icons/bluetooth.svg @@ -65,7 +65,7 @@ Date: Tue, 18 Aug 2026 18:45:53 -0700 Subject: [PATCH 5/7] fix line mask --- data/icons/bluetooth.svg | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/data/icons/bluetooth.svg b/data/icons/bluetooth.svg index b79a7c6c..17fc9c31 100644 --- a/data/icons/bluetooth.svg +++ b/data/icons/bluetooth.svg @@ -65,7 +65,7 @@ Date: Fri, 21 Aug 2026 09:45:56 -0700 Subject: [PATCH 6/7] Granite.Symbol: improve API (#239) --- data/icons/bluetooth.svg | 12 ++++----- src/Widgets/DisplayWidget.vala | 6 ++--- src/Widgets/Symbol.vala | 48 +++++++++++++++++++++++++++++----- 3 files changed, 51 insertions(+), 15 deletions(-) diff --git a/data/icons/bluetooth.svg b/data/icons/bluetooth.svg index 17fc9c31..e9932cdf 100644 --- a/data/icons/bluetooth.svg +++ b/data/icons/bluetooth.svg @@ -3,7 +3,7 @@ xmlns:svg='http://www.w3.org/2000/svg' xmlns:gpa='https://www.gtk.org/grappa' gpa:version='1' - gpa:state-names='state0 state1 state2' + gpa:state-names='normal disabled active' gpa:state='0' id='svg6' width='24' @@ -18,7 +18,7 @@ fill-rule='nonzero' overflow='visible' d='M 11.5 5 C 11.223 5, 11 5.223, 11 5.5 L 11 10.375 L 9.281 8.875 C 8.968 8.602, 8.523 8.655, 8.251 8.969 A 0.753 0.753 0 0 0 8.313 10.031 L 10.563 12 L 8.313 13.969 A 0.753 0.753 0 0 0 8.25 15.031 C 8.523 15.344, 8.968 15.398, 9.281 15.125 L 11.001 13.625 L 11.001 18.5 C 11.001 18.777, 11.223 19, 11.501 19 C 11.783 19, 11.938 18.98, 12.156 18.812 L 15.688 15.656 A 0.78 0.78 0 0 0 15.906 15.281 A 0.745 0.745 0 0 0 15.938 15 A 0.723 0.723 0 0 0 15.906 14.844 A 0.78 0.78 0 0 0 15.688 14.469 L 12.875 11.999 L 15.688 9.531 A 0.78 0.78 0 0 0 15.906 9.156 A 0.71 0.71 0 0 0 15.906 8.719 A 0.78 0.78 0 0 0 15.688 8.344 L 12.156 5.187 C 11.957 5.027, 11.729 5, 11.5 5 Z M 12 7.063 L 14.094 8.938 L 12 10.75 Z M 12 13.25 L 14.094 15.063 L 12 16.938 Z' - gpa:states='state0 state1 state2' + gpa:states='normal disabled active' gpa:animation-repeat='0' gpa:animation-segment='0'> @@ -39,7 +39,7 @@ y2='18.6085' gpa:stroke-minwidth='25%' gpa:stroke-maxwidth='200%' - gpa:states='state1' + gpa:states='disabled' gpa:transition-type='animate' gpa:transition-easing='ease-in-out' gpa:transition-duration='200ms'> @@ -52,7 +52,7 @@ fill-opacity='0.5' fill-rule='nonzero' d='M 6.31836 5 C 6.04055 5.00054, 5.78575 5.15461, 5.65625 5.40039 L 5.6543 5.40039 C 4.56857 7.43076, 4.00036 9.69757, 4 12 C 4.00035 14.3024, 4.56859 16.5692, 5.6543 18.5996 L 5.65625 18.5996 C 5.78576 18.8454, 6.04053 18.9995, 6.31836 19 C 6.73257 19, 7.06836 18.6642, 7.06836 18.25 C 7.068 18.1251, 7.03645 18.0022, 6.97656 17.8926 C 6.00732 16.0797, 5.50016 14.0557, 5.5 12 C 5.50016 9.94428, 6.00733 7.92031, 6.97656 6.10742 C 7.03645 5.99779, 7.068 5.87493, 7.06836 5.75 C 7.06836 5.33579, 6.73257 5, 6.31836 5 Z M 17.6816 5 C 17.2674 5, 16.9316 5.33579, 16.9316 5.75 C 16.932 5.87493, 16.9636 5.99779, 17.0234 6.10742 C 17.9927 7.92031, 18.4998 9.94428, 18.5 12 C 18.4998 14.0557, 17.9927 16.0797, 17.0234 17.8926 C 16.9635 18.0022, 16.932 18.1251, 16.9316 18.25 C 16.9316 18.6642, 17.2674 19, 17.6816 19 C 17.9595 18.9995, 18.2142 18.8454, 18.3437 18.5996 L 18.3457 18.5996 C 19.4314 16.5692, 19.9997 14.3024, 20 12 C 19.9996 9.69757, 19.4314 7.43076, 18.3457 5.40039 L 18.3437 5.40039 C 18.2143 5.15461, 17.9594 5.00054, 17.6816 5 Z' - gpa:states='state2' + gpa:states='active' gpa:transition-type='fade' gpa:transition-easing='ease-in-out' gpa:transition-duration='200ms' @@ -88,7 +88,7 @@ y2='20.23' gpa:stroke-minwidth='25%' gpa:stroke-maxwidth='200%' - gpa:states='state1' + gpa:states='disabled' gpa:transition-type='animate' gpa:transition-easing='ease-in-out' gpa:transition-duration='200ms'> @@ -113,7 +113,7 @@ ry='1' gpa:stroke-minwidth='25%' gpa:stroke-maxwidth='150%' - gpa:states='state1' + gpa:states='disabled' gpa:transition-type='fade' gpa:transition-easing='ease-in-out' gpa:transition-duration='200ms'> diff --git a/src/Widgets/DisplayWidget.vala b/src/Widgets/DisplayWidget.vala index b14ede6e..a61f585a 100644 --- a/src/Widgets/DisplayWidget.vala +++ b/src/Widgets/DisplayWidget.vala @@ -60,14 +60,14 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Granite.Bin { if (state) { context = _("Middle-click to turn Bluetooth off"); if (connected) { - symbol.state = Granite.Symbol.STATE_CHECKED; + symbol.state = Granite.SymbolState.ACTIVE; description = _("Bluetooth connected"); } else { - symbol.state = Granite.Symbol.STATE_NORMAL; + symbol.state = Granite.SymbolState.NORMAL; description = _("Bluetooth is on"); } } else { - symbol.state = Granite.Symbol.STATE_DISABLED; + symbol.state = Granite.SymbolState.DISABLED; description = _("Bluetooth is off"); context = _("Middle-click to turn Bluetooth on"); } diff --git a/src/Widgets/Symbol.vala b/src/Widgets/Symbol.vala index 30b0d624..dbc77b5e 100644 --- a/src/Widgets/Symbol.vala +++ b/src/Widgets/Symbol.vala @@ -3,11 +3,16 @@ * SPDX-FileCopyrightText: 2026 elementary, Inc. (https://elementary.io) */ -public class Granite.Symbol : Granite.Bin { - public const int STATE_NORMAL = 0; - public const int STATE_DISABLED = 1; - public const int STATE_CHECKED = 2; +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 { @@ -15,9 +20,40 @@ public class Granite.Symbol : Granite.Bin { set { image.pixel_size = value; } } - public uint state { + public uint state_index { get { return svg.state; } - set { svg.state = value; } + 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; From 6f396f9b7574972ec201a9adcf5b83016de20003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 24 Aug 2026 10:17:04 -0700 Subject: [PATCH 7/7] Change to BluetoothIndicator.Symbol for now --- meson.build | 2 +- src/Widgets/DisplayWidget.vala | 10 +++++----- src/Widgets/Symbol.vala | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 591bd452..e4f29ae9 100644 --- a/meson.build +++ b/meson.build @@ -47,7 +47,7 @@ shared_module( 'src/Widgets/Device.vala', 'src/Widgets/DisplayWidget.vala', 'src/Widgets/PopoverWidget.vala', - 'src' / 'Widgets' / 'Symbol.vala', + 'src/Widgets/Symbol.vala', config_file, gresource, dependencies: [ diff --git a/src/Widgets/DisplayWidget.vala b/src/Widgets/DisplayWidget.vala index a61f585a..4a9b3c49 100644 --- a/src/Widgets/DisplayWidget.vala +++ b/src/Widgets/DisplayWidget.vala @@ -6,14 +6,14 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Granite.Bin { public BluetoothIndicator.Services.ObjectManager object_manager { get; construct; } - private Granite.Symbol symbol; + private BluetoothIndicator.Symbol symbol; public DisplayWidget (BluetoothIndicator.Services.ObjectManager object_manager) { Object (object_manager: object_manager); } construct { - symbol = new Granite.Symbol ("/io/elementary/wingpanel/bluetooth/icons/bluetooth.svg") { + symbol = new BluetoothIndicator.Symbol ("/io/elementary/wingpanel/bluetooth/icons/bluetooth.svg") { pixel_size = 24 }; @@ -60,14 +60,14 @@ public class BluetoothIndicator.Widgets.DisplayWidget : Granite.Bin { if (state) { context = _("Middle-click to turn Bluetooth off"); if (connected) { - symbol.state = Granite.SymbolState.ACTIVE; + symbol.state = BluetoothIndicator.SymbolState.ACTIVE; description = _("Bluetooth connected"); } else { - symbol.state = Granite.SymbolState.NORMAL; + symbol.state = BluetoothIndicator.SymbolState.NORMAL; description = _("Bluetooth is on"); } } else { - symbol.state = Granite.SymbolState.DISABLED; + symbol.state = BluetoothIndicator.SymbolState.DISABLED; description = _("Bluetooth is off"); context = _("Middle-click to turn Bluetooth on"); } diff --git a/src/Widgets/Symbol.vala b/src/Widgets/Symbol.vala index dbc77b5e..7efa0ce4 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 BluetoothIndicator.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 BluetoothIndicator.Symbol : Granite.Bin { public string resource_path { get; construct; } public int pixel_size {