css: Add min-width/height CSS properties

This commit is contained in:
Benjamin Otte 2012-12-13 03:10:25 +01:00 committed by Matthias Clasen
parent a920f7260c
commit 0fb01decba
2 changed files with 30 additions and 0 deletions

View File

@ -843,6 +843,15 @@ border_image_width_parse (GtkCssStyleProperty *property,
FALSE); FALSE);
} }
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 * static GtkCssValue *
transition_property_parse_one (GtkCssParser *parser) transition_property_parse_one (GtkCssParser *parser)
{ {
@ -1605,6 +1614,25 @@ _gtk_css_style_property_init_properties (void)
NULL, NULL,
_gtk_css_transform_value_new_none ()); _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_style_property_register ("transition-property",
GTK_CSS_PROPERTY_TRANSITION_PROPERTY, GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
G_TYPE_NONE, G_TYPE_NONE,

View File

@ -203,6 +203,8 @@ enum { /*< skip >*/
GTK_CSS_PROPERTY_ICON_SHADOW, GTK_CSS_PROPERTY_ICON_SHADOW,
GTK_CSS_PROPERTY_ICON_STYLE, GTK_CSS_PROPERTY_ICON_STYLE,
GTK_CSS_PROPERTY_ICON_TRANSFORM, GTK_CSS_PROPERTY_ICON_TRANSFORM,
GTK_CSS_PROPERTY_MIN_WIDTH,
GTK_CSS_PROPERTY_MIN_HEIGHT,
GTK_CSS_PROPERTY_TRANSITION_PROPERTY, GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
GTK_CSS_PROPERTY_TRANSITION_DURATION, GTK_CSS_PROPERTY_TRANSITION_DURATION,
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION, GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,