Fix 'Apply' when changing scaling options only
authorRicardo Mones <ricardo@mones.org>
Wed, 15 Feb 2017 23:40:46 +0000 (00:40 +0100)
committerRicardo Mones <ricardo@mones.org>
Wed, 15 Feb 2017 23:40:46 +0000 (00:40 +0100)
src/prefs_themes.c
src/stock_pixmap.c
src/stock_pixmap.h

index fc81582..10f6baf 100644 (file)
@@ -1215,8 +1215,8 @@ static void prefs_themes_save(PrefsPage *page)
                                && scaling_ppi != prefs_common.pixmap_scaling_ppi)) {
                /* same theme, different scaling options */
                debug_print("Updating theme scaling\n");
-
-               main_window_reflect_prefs_all_real(FALSE);
+               stock_pixmap_invalidate_all_icons();
+               main_window_reflect_prefs_all_real(TRUE);
                compose_reflect_prefs_pixmap_theme();
                addrcompl_reflect_prefs_pixmap_theme();
        }
index 007864d..58fc013 100644 (file)
@@ -839,6 +839,25 @@ void stock_pixmap_themes_list_free(GList *list)
        g_list_free(list);
 }
 
+void stock_pixmap_invalidate_all_icons(void)
+{
+       StockPixmapData *pix_d;
+       int i = 0;
+
+       while (i < N_STOCK_PIXMAPS) {
+               pix_d = &pixmaps[i];
+               if (pix_d->pixbuf) {
+                       g_object_unref(G_OBJECT(pix_d->pixbuf));
+                       pix_d->pixbuf = NULL;
+               }
+               if (pix_d->pixmap) {
+                       g_object_unref(G_OBJECT(pix_d->pixmap));
+                       pix_d->pixmap = NULL;
+               }
+               i++;
+       }
+}
+
 gchar *stock_pixmap_get_name (StockPixmap icon)
 {
        if (icon >= N_STOCK_PIXMAPS)
index 582b4fa..87fa1c4 100644 (file)
@@ -237,6 +237,7 @@ gint stock_pixbuf_gdk               (StockPixmap icon, GdkPixbuf **pixbuf);
 
 GList *stock_pixmap_themes_list_new    (void);
 void stock_pixmap_themes_list_free     (GList *list);
+void stock_pixmap_invalidate_all_icons (void);
 gchar *stock_pixmap_get_name         (StockPixmap icon);
 StockPixmap stock_pixmap_get_icon    (gchar *file);
 GtkWidget *stock_pixmap_widget_with_overlay (StockPixmap        icon,