[gtk+] styleproperties: resolve properties of type GTK_TYPE_SHADOW



commit c3f3e4a6702cec54b1c835ee0c539a2763674d1b
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri May 20 16:11:41 2011 -0400

    styleproperties: resolve properties of type GTK_TYPE_SHADOW
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649314

 gtk/gtkstyleproperties.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
index 88467ae..9358605 100644
--- a/gtk/gtkstyleproperties.c
+++ b/gtk/gtkstyleproperties.c
@@ -846,6 +846,29 @@ resolve_gradient (GtkStyleProperties *props,
 }
 
 static gboolean
+resolve_shadow (GtkStyleProperties *props,
+                GValue *value)
+{
+  GtkShadow *resolved, *base;
+
+  base = g_value_get_boxed (value);
+
+  if (base == NULL)
+    return TRUE;
+  
+  if (_gtk_shadow_get_resolved (base))
+    return TRUE;
+
+  resolved = _gtk_shadow_resolve (base, props);
+  if (resolved == NULL)
+    return FALSE;
+
+  g_value_take_boxed (value, resolved);
+
+  return TRUE;
+}
+
+static gboolean
 style_properties_resolve_type (GtkStyleProperties *props,
                                PropertyNode       *node,
                                GValue             *val)
@@ -872,6 +895,11 @@ style_properties_resolve_type (GtkStyleProperties *props,
       if (!resolve_gradient (props, val))
         return FALSE;
     }
+  else if (val && G_VALUE_TYPE (val) == GTK_TYPE_SHADOW)
+    {
+      if (!resolve_shadow (props, val))
+        return FALSE;
+    }
 
   return TRUE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]