[gtk+/wip/cssnode3: 86/91] css: Add min-width/height CSS properties
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssnode3: 86/91] css: Add min-width/height CSS properties
- Date: Mon, 9 Mar 2015 14:12:44 +0000 (UTC)
commit e0e4c7e1704f0e439d3d2b0815d9d25e9c8c37d5
Author: Benjamin Otte <otte redhat com>
Date: Thu Dec 13 03:10:25 2012 +0100
css: Add min-width/height CSS properties
Nothing is using them yet.
gtk/gtkcssstylepropertyimpl.c | 28 ++++++++++++++++++++++++++++
gtk/gtkcsstypesprivate.h | 2 ++
2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 45fa695..e6f77ef 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -805,6 +805,15 @@ border_image_width_parse (GtkCssStyleProperty *property,
}
static GtkCssValue *
+minmax_parse (GtkCssStyleProperty *property,
+ GtkCssParser *parser)
+{
+ return _gtk_css_number_value_parse (parser,
+ GTK_CSS_PARSE_LENGTH
+ | GTK_CSS_POSITIVE_ONLY);
+}
+
+static GtkCssValue *
transition_property_parse_one (GtkCssParser *parser)
{
GtkCssValue *value;
@@ -1529,6 +1538,25 @@ _gtk_css_style_property_init_properties (void)
NULL,
_gtk_css_transform_value_new_none ());
+ gtk_css_style_property_register ("min-width",
+ GTK_CSS_PROPERTY_MIN_WIDTH,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_ANIMATED,
+ GTK_CSS_AFFECTS_SIZE,
+ minmax_parse,
+ NULL,
+ NULL,
+ _gtk_css_number_value_new (0, GTK_CSS_PX));
+ gtk_css_style_property_register ("min-height",
+ GTK_CSS_PROPERTY_MIN_HEIGHT,
+ G_TYPE_NONE,
+ GTK_STYLE_PROPERTY_ANIMATED,
+ GTK_CSS_AFFECTS_SIZE,
+ minmax_parse,
+ NULL,
+ NULL,
+ _gtk_css_number_value_new (0, GTK_CSS_PX));
+
gtk_css_style_property_register ("transition-property",
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
G_TYPE_NONE,
diff --git a/gtk/gtkcsstypesprivate.h b/gtk/gtkcsstypesprivate.h
index 1f68e9c..2b6b80c 100644
--- a/gtk/gtkcsstypesprivate.h
+++ b/gtk/gtkcsstypesprivate.h
@@ -164,6 +164,8 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_ICON_SHADOW,
GTK_CSS_PROPERTY_ICON_STYLE,
GTK_CSS_PROPERTY_ICON_TRANSFORM,
+ GTK_CSS_PROPERTY_MIN_WIDTH,
+ GTK_CSS_PROPERTY_MIN_HEIGHT,
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
GTK_CSS_PROPERTY_TRANSITION_DURATION,
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]