diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index 6588207d92..be0fb8a666 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -2297,6 +2297,27 @@ style_property_values_cmp (gconstpointer bsearch_node1, return 0; } +const GValue * +_gtk_style_context_peek_property (GtkStyleContext *context, + const char *property_name) +{ + GtkStyleProperty *property; + StyleData *data; + + property = _gtk_style_property_lookup (property_name); + if (!GTK_IS_CSS_STYLE_PROPERTY (property)) + { + g_warning ("Style property \"%s\" does not exist", property_name); + return NULL; + } + + data = style_data_lookup (context, gtk_style_context_get_state (context)); + + return _gtk_style_properties_peek_property (data->store, + GTK_CSS_STYLE_PROPERTY (property), + 0); +} + const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context, GType widget_type, diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h index 981eda76e2..ffde8db52e 100644 --- a/gtk/gtkstylecontextprivate.h +++ b/gtk/gtkstylecontextprivate.h @@ -25,6 +25,8 @@ G_BEGIN_DECLS +const GValue * _gtk_style_context_peek_property (GtkStyleContext *context, + const char *property_name); const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context, GType widget_type, GtkStateFlags state,