Philipp Hörist pushed to branch master at gajim / gajim


Commits:
829ee4a2 by Philipp Hörist at 2023-11-07T21:21:33+01:00
fix: Icons: Register icon size to make it work for scale > 1

- - - - -


3 changed files:

- gajim/gtk/accounts.py
- gajim/gtk/application.py
- gajim/gtk/chat_stack.py


Changes:

=====================================
gajim/gtk/accounts.py
=====================================
@@ -620,13 +620,10 @@ def __init__(self) -> None:
         self.set_vexpand(True)
         self.set_hexpand(True)
         self.set_margin_top(24)
-        pixbuf = Gtk.IconTheme.load_icon_for_scale(
-            Gtk.IconTheme.get_default(),
-            'org.gajim.Gajim-symbolic',
-            100,
-            self.get_scale_factor(),
-            Gtk.IconLookupFlags.FORCE_SIZE)
-        self.add(Gtk.Image.new_from_pixbuf(pixbuf))
+        image = Gtk.Image.new_from_icon_name(
+            'org.gajim.Gajim-symbolic', Gtk.IconSize.from_name('100'))
+        image.get_style_context().add_class('dim-label')
+        self.add(image)
 
         button = Gtk.Button(label=_('Add Account'))
         button.get_style_context().add_class('suggested-action')


=====================================
gajim/gtk/application.py
=====================================
@@ -226,6 +226,7 @@ def _startup(self) -> None:
 
         self._init_core()
 
+        Gtk.IconSize.register('100', 100, 100)
         icon_theme = Gtk.IconTheme.get_default()
         icon_theme.append_search_path(str(configpaths.get('ICONS')))
         load_user_iconsets()


=====================================
gajim/gtk/chat_stack.py
=====================================
@@ -827,13 +827,8 @@ def __init__(self):
         Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL,
                          spacing=18)
         self.set_valign(Gtk.Align.CENTER)
-        pixbuf = Gtk.IconTheme.load_icon_for_scale(
-            Gtk.IconTheme.get_default(),
-            'org.gajim.Gajim-symbolic',
-            100,
-            self.get_scale_factor(),
-            Gtk.IconLookupFlags.FORCE_SIZE)
-        image = Gtk.Image.new_from_pixbuf(pixbuf)
+        image = Gtk.Image.new_from_icon_name(
+            'org.gajim.Gajim-symbolic', Gtk.IconSize.from_name('100'))
         image.get_style_context().add_class('dim-label')
         self.add(image)
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/829ee4a2c34f3605093daf99efb21e3120bbbc48

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/829ee4a2c34f3605093daf99efb21e3120bbbc48
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to