[gtk+] Remove broken optimization in style modifier overrides
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Remove broken optimization in style modifier overrides
- Date: Tue, 6 Dec 2011 13:12:49 +0000 (UTC)
commit 7bd2446801ffd0fc2ac5cc98fcd675ac4f3935d6
Author: Alexander Larsson <alexl redhat com>
Date: Tue Dec 6 14:09:45 2011 +0100
Remove broken optimization in style modifier overrides
We used to only set the override color or font if it was different
than the existing value. However, that means you can't change it to
an override that is the same as the default value for the property.
With this fixed you can e.g. override with a color of 0,0,0,0 which
you couldn't before.
gtk/gtkmodifierstyle.c | 23 -----------------------
1 files changed, 0 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index 8d4a18c..fd84cae 100644
--- a/gtk/gtkmodifierstyle.c
+++ b/gtk/gtkmodifierstyle.c
@@ -162,16 +162,6 @@ modifier_style_set_color (GtkModifierStyle *style,
g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
priv = style->priv;
- gtk_style_properties_get (priv->style, state,
- prop, &old_color,
- NULL);
-
- if ((!color && !old_color) ||
- (color && old_color && gdk_rgba_equal (color, old_color)))
- {
- gdk_rgba_free (old_color);
- return;
- }
if (color)
gtk_style_properties_set (priv->style, state,
@@ -214,19 +204,6 @@ _gtk_modifier_style_set_font (GtkModifierStyle *style,
g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
priv = style->priv;
- gtk_style_properties_get (priv->style, 0,
- "font", &old_font,
- NULL);
-
- if ((!old_font && !font_desc) ||
- (old_font && font_desc &&
- pango_font_description_equal (old_font, font_desc)))
- {
- if (old_font)
- pango_font_description_free (old_font);
-
- return;
- }
if (font_desc)
gtk_style_properties_set (priv->style, 0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]