From f3caf8b091efeaa48f05c3dd9595dceaada2346c Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Fri, 31 Aug 2012 09:54:32 +0200
Subject: [PATCH] add 24x24 icons. Take them from 32x32 if they don't exist in
 the iconset. Fixes #7225

---
 src/gtkgui_helpers.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index 5588b35183..426bfb53b9 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -1045,6 +1045,19 @@ def make_jabber_state_images():
     path = os.path.join(helpers.get_iconset_path(iconset), '32x32')
     gajim.interface.jabber_state_images['32'] = load_iconset(path)
 
+    path = os.path.join(helpers.get_iconset_path(iconset), '24x24')
+    if (os.path.exists(path)):
+        gajim.interface.jabber_state_images['24'] = load_iconset(path)
+    else:
+        gajim.interface.jabber_state_images['24'] = {}
+        # Resize 32x32 icons to 24x24
+        for each in gajim.interface.jabber_state_images['32']:
+            img = gtk.Image()
+            pix = gajim.interface.jabber_state_images['32'][each].get_pixbuf()
+            scaled_pix = pix.scale_simple(24, 24, gtk.gdk.INTERP_BILINEAR)
+            img.set_from_pixbuf(scaled_pix)
+            gajim.interface.jabber_state_images['24'][each] = img
+
     path = os.path.join(helpers.get_iconset_path(iconset), '16x16')
     gajim.interface.jabber_state_images['16'] = load_iconset(path)
 
-- 
GitLab