Avoid using gtk_widget_set_style(), so these widgets can get theme or
authorColin Leroy <colin@colino.net>
Thu, 22 May 2014 12:58:19 +0000 (14:58 +0200)
committerColin Leroy <colin@colino.net>
Thu, 22 May 2014 12:59:18 +0000 (14:59 +0200)
DPI changes signals and react accordingly.

src/folderview.c
src/gtk/gtkcmclist.c

index f3df646..209c617 100644 (file)
@@ -681,8 +681,6 @@ void folderview_init(FolderView *folderview)
                gtkut_convert_int_to_gdk_color(prefs_common.color_new, &gdk_color);
                normal_color_style = gtk_style_copy(normal_style);
                normal_color_style->fg[GTK_STATE_NORMAL] = gdk_color;
-
-               gtk_widget_set_style(ctree, normal_style);
        }
 
        if (!bold_style) {
index f4bee46..fe0c071 100644 (file)
@@ -4599,7 +4599,7 @@ gtk_cmclist_realize (GtkWidget *widget)
 {
   GtkAllocation allocation;
   GtkCMCList *clist;
-  GtkStyle *style;
+  GtkStyle *style, *attached_style;
   GdkWindow *window;
   GdkWindowAttr attributes;
   GtkCMCListRow *clist_row;
@@ -4648,8 +4648,11 @@ gtk_cmclist_realize (GtkWidget *widget)
   gtk_widget_set_window (widget, window);
 
   style = gtk_widget_get_style (widget);
-  style = gtk_style_attach (style, window);
-  gtk_widget_set_style (widget, style);
+  attached_style = gtk_style_attach (style, window);
+  if (attached_style != style) {
+       gtk_widget_set_style(widget, attached_style);
+       style = attached_style;
+  }
 
   gtk_style_set_background (style, window, GTK_STATE_NORMAL);