talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 6b252626a3bdeafedcfd7a364db1c9e1e224b49c
parent 73eccfcf85222e639ffae17c324ea405fb8babb8
Author: Colin Leroy <colin@colino.net>
Date:   Thu, 22 May 2014 14:58:19 +0200

Avoid using gtk_widget_set_style(), so these widgets can get theme or
DPI changes signals and react accordingly.

Diffstat:
Msrc/folderview.c | 2--
Msrc/gtk/gtkcmclist.c | 9++++++---
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/folderview.c b/src/folderview.c @@ -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) { diff --git a/src/gtk/gtkcmclist.c b/src/gtk/gtkcmclist.c @@ -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);