Fix 'Apply' when changing scaling options only

This commit is contained in:
Ricardo Mones 2017-02-16 00:40:46 +01:00
parent 5d95cf07a8
commit d6dfb9960c
3 changed files with 22 additions and 2 deletions

View 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();
}

View 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)

View 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,