[gtk+/gtk-style-context: 525/533] GtkWidget: unset NULL properties when overriding style.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 525/533] GtkWidget: unset NULL properties when overriding style.
- Date: Wed, 1 Dec 2010 02:49:59 +0000 (UTC)
commit b5d9f90726eb59a85148566188c8cad15d289f08
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 7ab4a9c..58f6995 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8032,9 +8032,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);
@@ -8069,9 +8072,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);
@@ -8105,9 +8113,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]