[gtk+] GtkWidget: unset NULL properties when overriding style.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkWidget: unset NULL properties when overriding style.
- Date: Sat, 4 Dec 2010 15:26:33 +0000 (UTC)
commit 46de2130d3bb6ad5dd0ffcefb9662b65d9db2690
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Nov 29 11:27:43 2010 +0100
GtkWidget: unset NULL properties when overriding style.
gtk/gtkwidget.c | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 1c0bfee..d84e9be 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8002,9 +8002,12 @@ gtk_widget_override_color (GtkWidget *widget,
properties = _gtk_widget_get_modifier_properties (widget);
- gtk_style_properties_set (properties, state,
- "color", color,
- NULL);
+ if (color)
+ gtk_style_properties_set (properties, state,
+ "color", color,
+ NULL);
+ else
+ gtk_style_properties_unset_property (properties, "color", state);
context = gtk_widget_get_style_context (widget);
gtk_style_context_invalidate (context);
@@ -8039,9 +8042,14 @@ gtk_widget_override_background_color (GtkWidget *widget,
properties = _gtk_widget_get_modifier_properties (widget);
- gtk_style_properties_set (properties, state,
- "background-color", color,
- NULL);
+ if (color)
+ gtk_style_properties_set (properties, state,
+ "background-color", color,
+ NULL);
+ else
+ gtk_style_properties_unset_property (properties,
+ "background-color",
+ state);
context = gtk_widget_get_style_context (widget);
gtk_style_context_invalidate (context);
@@ -8075,9 +8083,12 @@ gtk_widget_override_font (GtkWidget *widget,
properties = _gtk_widget_get_modifier_properties (widget);
- gtk_style_properties_set (properties, 0,
- "font", font_desc,
- NULL);
+ if (font_desc)
+ gtk_style_properties_set (properties, 0,
+ "font", font_desc,
+ NULL);
+ else
+ gtk_style_properties_unset_property (properties, "font", 0);
context = gtk_widget_get_style_context (widget);
gtk_style_context_invalidate (context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]