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




commit a8770a963863ee9194ebaf76b4cd4f003b3fd305
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 735c751f2..41d6852b1 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -2225,15 +2225,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]