Fix custom about dialog style overriding
Don't assume changing the style inside a style-set handler results in recursion, as it would be wrong if the next signal emission was triggered asynchronously. Instead, only modify the style if it isn't already as we want it. This fixes the about dialog's style-set handlers on GTK 3.10 which didn't liked constant style updating.
This commit is contained in:
parent
76d6e9faa9
commit
20c31b62ff
22
src/about.c
22
src/about.c
@ -458,31 +458,17 @@ void about_dialog_show(void)
|
|||||||
|
|
||||||
static void header_eventbox_style_set(GtkWidget *widget)
|
static void header_eventbox_style_set(GtkWidget *widget)
|
||||||
{
|
{
|
||||||
static gint recursive = 0;
|
GtkStyle *style = gtk_widget_get_style(widget);
|
||||||
GtkStyle *style;
|
if (! gdk_color_equal(&style->bg[GTK_STATE_NORMAL], &style->bg[GTK_STATE_SELECTED]))
|
||||||
|
|
||||||
if (recursive > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
++recursive;
|
|
||||||
style = gtk_widget_get_style(widget);
|
|
||||||
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &style->bg[GTK_STATE_SELECTED]);
|
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &style->bg[GTK_STATE_SELECTED]);
|
||||||
--recursive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void header_label_style_set(GtkWidget *widget)
|
static void header_label_style_set(GtkWidget *widget)
|
||||||
{
|
{
|
||||||
static gint recursive = 0;
|
GtkStyle *style = gtk_widget_get_style(widget);
|
||||||
GtkStyle *style;
|
if (! gdk_color_equal(&style->fg[GTK_STATE_NORMAL], &style->fg[GTK_STATE_SELECTED]))
|
||||||
|
|
||||||
if (recursive > 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
++recursive;
|
|
||||||
style = gtk_widget_get_style(widget);
|
|
||||||
gtk_widget_modify_fg(widget, GTK_STATE_NORMAL, &style->fg[GTK_STATE_SELECTED]);
|
gtk_widget_modify_fg(widget, GTK_STATE_NORMAL, &style->fg[GTK_STATE_SELECTED]);
|
||||||
--recursive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user