[balsa/gtk4: 200/294] balsa-icons: Get the icon theme for main-window




commit d8272ca24abb0c0625768be5af206e9bada5f9a0
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Oct 17 18:07:59 2020 -0400

    balsa-icons: Get the icon theme for main-window

 src/balsa-icons.c | 5 +++--
 src/main-window.c | 8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/balsa-icons.c b/src/balsa-icons.c
index 4270db272..3b22fcf70 100644
--- a/src/balsa-icons.c
+++ b/src/balsa-icons.c
@@ -93,7 +93,7 @@ load_balsa_pixmap(GtkIconTheme *icon_theme, const balsa_pixmap_t *bpixmap)
 }
 
 void
-balsa_register_pixmaps(void)
+balsa_register_pixmaps(BalsaWindow *window)
 {
     const balsa_pixmap_t balsa_icons[] = {
        /* icons for buttons and menus (24x24 and 16x16) */
@@ -164,7 +164,8 @@ balsa_register_pixmaps(void)
        };
 
     unsigned i;
-    GtkIconTheme *icon_theme = gtk_icon_theme_get_default();
+    GtkIconTheme *icon_theme =
+        gtk_icon_theme_get_for_display(gtk_widget_get_display(GTK_WIDGET(window)));
 
     balsa_icon_table =
         g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
diff --git a/src/main-window.c b/src/main-window.c
index 7d2ed9054..6e3171d28 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -2269,15 +2269,15 @@ balsa_window_new(GtkApplication *application)
     GtkAdjustment *hadj, *vadj;
     GAction *action;
 
-    /* Call to register custom balsa pixmaps with GNOME_STOCK_PIXMAPS
-     * - allows for grey out */
-    balsa_register_pixmaps();
-
     window = g_object_new(BALSA_TYPE_WINDOW,
                           "application", application,
                           NULL);
     priv = balsa_window_get_instance_private(window);
 
+    /* Call to register custom balsa pixmaps with GNOME_STOCK_PIXMAPS
+     * - allows for grey out */
+    balsa_register_pixmaps(window);
+
     priv->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     gtk_widget_show(priv->vbox);
     gtk_container_add(GTK_CONTAINER(window), priv->vbox);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]