commit d6dfb9960cc1c8d25a1dbfaf6958fb82e596c46b
parent 5d95cf07a8d2edff3109ba341757662b40fcae99
Author: Ricardo Mones <ricardo@mones.org>
Date: Thu, 16 Feb 2017 00:40:46 +0100
Fix 'Apply' when changing scaling options only
Diffstat:
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/prefs_themes.c b/src/prefs_themes.c
@@ -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();
}
diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
@@ -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)
diff --git a/src/stock_pixmap.h b/src/stock_pixmap.h
@@ -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,