[gtk+/wip/matthiasc/icon-size: 1/15] css: Add -gtk-icon-size
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/icon-size: 1/15] css: Add -gtk-icon-size
- Date: Wed, 15 Nov 2017 04:33:58 +0000 (UTC)
commit 6d626a8d3d693eee7eda3843fceb166b0f65409a
Author: Benjamin Otte <otte redhat com>
Date: Fri Jan 20 01:50:50 2017 +0100
css: Add -gtk-icon-size
This will replace GtkIconSize in future patches.
gtk/gtkcssstylepropertyimpl.c | 18 ++++++++++++++++++
gtk/gtkcsstypesprivate.h | 1 +
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 8f714d8..a07a345 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -391,6 +391,16 @@ parse_css_fill_mode (GtkCssStyleProperty *property,
}
static GtkCssValue *
+icon_size_parse (GtkCssStyleProperty *property,
+ GtkCssParser *parser)
+{
+ return _gtk_css_number_value_parse (parser,
+ GTK_CSS_PARSE_LENGTH
+ | GTK_CSS_PARSE_PERCENT
+ | GTK_CSS_POSITIVE_ONLY);
+}
+
+static GtkCssValue *
icon_palette_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
@@ -1580,6 +1590,14 @@ _gtk_css_style_property_init_properties (void)
css_image_value_parse_with_builtin,
NULL,
_gtk_css_image_value_new (gtk_css_image_builtin_new ()));
+ gtk_css_style_property_register ("-gtk-icon-size",
+ GTK_CSS_PROPERTY_ICON_SIZE,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
+ GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_ICON |
GTK_CSS_AFFECTS_SYMBOLIC_ICON,
+ icon_size_parse,
+ NULL,
+ _gtk_css_number_value_new (16, GTK_CSS_PX));
gtk_css_style_property_register ("-gtk-icon-shadow",
GTK_CSS_PROPERTY_ICON_SHADOW,
G_TYPE_NONE,
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index c569ec6..9177467 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -218,6 +218,7 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE,
GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH,
GTK_CSS_PROPERTY_ICON_SOURCE,
+ GTK_CSS_PROPERTY_ICON_SIZE,
GTK_CSS_PROPERTY_ICON_SHADOW,
GTK_CSS_PROPERTY_ICON_STYLE,
GTK_CSS_PROPERTY_ICON_TRANSFORM,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]