summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstylepropertyimpl.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-01-27 00:25:05 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-27 05:04:34 +0100
commit11d70f1ac30dd491d9d8dac9b9e2c31cee073cc9 (patch)
tree1f76fae360676a9e5545d6d315818660e99578a1 /gtk/gtkcssstylepropertyimpl.c
parent9cbf04c1d2db22001995b9851587b475ffcefe44 (diff)
downloadgtk+-11d70f1ac30dd491d9d8dac9b9e2c31cee073cc9.tar.gz
css: Add a -gtk-icon-theme CSS property
The property is useless to set (it only allows 'initial', 'inherit' and 'unset' as values), but it is used to track changes to the icon theme. And as such, it can ensure that widgets can track when they need to reload icons. https://bugzilla.gnome.org/show_bug.cgi?id=743341
Diffstat (limited to 'gtk/gtkcssstylepropertyimpl.c')
-rw-r--r--gtk/gtkcssstylepropertyimpl.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index bc40a06357..9f6b48192d 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -45,6 +45,7 @@
#include "gtkcsscornervalueprivate.h"
#include "gtkcsseasevalueprivate.h"
#include "gtkcssenginevalueprivate.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkcssimageprivate.h"
#include "gtkcssimagebuiltinprivate.h"
#include "gtkcssimagegradientprivate.h"
@@ -945,6 +946,15 @@ background_position_parse (GtkCssStyleProperty *property,
return _gtk_css_array_value_parse (parser, _gtk_css_position_value_parse);
}
+static GtkCssValue *
+icon_theme_value_parse (GtkCssStyleProperty *property,
+ GtkCssParser *parser)
+{
+ _gtk_css_parser_error (parser, "Only 'inherit', 'initial' or 'unset' are allowed");
+
+ return NULL;
+}
+
/*** REGISTRATION ***/
void
@@ -975,6 +985,15 @@ _gtk_css_style_property_init_properties (void)
/* properties that aren't referenced when computing values
* start here */
+ gtk_css_style_property_register ("-gtk-icon-theme",
+ GTK_CSS_PROPERTY_ICON_THEME,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_INHERIT,
+ GTK_CSS_AFFECTS_ICON,
+ icon_theme_value_parse,
+ NULL,
+ NULL,
+ _gtk_css_icon_theme_value_new());
gtk_css_style_property_register ("background-color",
GTK_CSS_PROPERTY_BACKGROUND_COLOR,
GDK_TYPE_RGBA,