Skip to content

Commit 518dda8

Browse files
committed
Fix category icons to change color if using dark or light theme
1 parent 3439eae commit 518dda8

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

Binary file not shown.
Binary file not shown.

bigcontrolcenter/usr/share/biglinux/bigcontrolcenter/ui/category_sidebar.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
gi.require_version("Gtk", "4.0")
1010
gi.require_version("Adw", "1")
11-
from gi.repository import Gtk, Pango, Gdk
11+
from gi.repository import Gtk, Pango, Gdk, Gio
1212

1313
# Setup translations
1414
lang_translations = gettext.translation(
@@ -214,13 +214,14 @@ def _create_category_button(self, category):
214214
# Create icon with consistent sizing
215215
icon = None
216216
if "icon_static" in category and os.path.exists(category["icon_static"]):
217-
# Use static icon by default
218-
icon = Gtk.Image.new_from_file(category["icon_static"])
219-
icon.add_css_class("symbolic")
217+
# Use Gio.FileIcon to load SVG as symbolic icon
218+
# This allows GTK to apply theme colors (dark/light mode)
219+
file_icon = Gio.FileIcon.new(Gio.File.new_for_path(category["icon_static"]))
220+
icon = Gtk.Image.new_from_gicon(file_icon)
220221
else:
221222
# Use system fallback icon
222223
icon = Gtk.Image.new_from_icon_name(category["icon"])
223-
icon.add_css_class("symbolic")
224+
icon.add_css_class("symbolic")
224225

225226
icon.set_pixel_size(22)
226227
icon.set_margin_end(8)
Binary file not shown.

0 commit comments

Comments
 (0)