diff options
author | Benjamin Otte <otte@redhat.com> | 2012-01-02 02:45:52 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-01-09 18:37:54 +0100 |
commit | ea6a8983443f999cb10f3b6bf7dc4440e6635288 (patch) | |
tree | 116b9b0af1ca960320016aa7a0a033df52e58fbc /gtk/gtkstyleproperty.c | |
parent | fdb3abefc374a80648c9019894d7edc9e86182b3 (diff) | |
download | gtk+-ea6a8983443f999cb10f3b6bf7dc4440e6635288.tar.gz |
styleproperty: Set a default value for border-*-radius
That way, we don't have to check if it is indeed set.
Diffstat (limited to 'gtk/gtkstyleproperty.c')
-rw-r--r-- | gtk/gtkstyleproperty.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c index 78037f3796..0bc2275a18 100644 --- a/gtk/gtkstyleproperty.c +++ b/gtk/gtkstyleproperty.c @@ -530,6 +530,7 @@ gtk_style_property_init_properties (void) GValue value = { 0, }; char *default_font_family[] = { "Sans", NULL }; GdkRGBA rgba; + GtkCssBorderCornerRadius no_corner_radius = { 0, }; if (G_LIKELY (initialized)) return; @@ -703,6 +704,8 @@ gtk_style_property_init_properties (void) "Border width at right", 0, G_MAXINT, 0, 0)); + g_value_init (&value, GTK_TYPE_CSS_BORDER_CORNER_RADIUS); + g_value_set_boxed (&value, &no_corner_radius); _gtk_style_property_register (g_param_spec_boxed ("border-top-left-radius", "Border top left radius", "Border radius of top left corner, in pixels", @@ -711,7 +714,7 @@ gtk_style_property_init_properties (void) NULL, border_corner_radius_value_parse, border_corner_radius_value_print, - NULL); + &value); _gtk_style_property_register (g_param_spec_boxed ("border-top-right-radius", "Border top right radius", "Border radius of top right corner, in pixels", @@ -720,7 +723,7 @@ gtk_style_property_init_properties (void) NULL, border_corner_radius_value_parse, border_corner_radius_value_print, - NULL); + &value); _gtk_style_property_register (g_param_spec_boxed ("border-bottom-right-radius", "Border bottom right radius", "Border radius of bottom right corner, in pixels", @@ -729,7 +732,7 @@ gtk_style_property_init_properties (void) NULL, border_corner_radius_value_parse, border_corner_radius_value_print, - NULL); + &value); _gtk_style_property_register (g_param_spec_boxed ("border-bottom-left-radius", "Border bottom left radius", "Border radius of bottom left corner, in pixels", @@ -738,7 +741,8 @@ gtk_style_property_init_properties (void) NULL, border_corner_radius_value_parse, border_corner_radius_value_print, - NULL); + &value); + g_value_unset (&value); gtk_style_properties_register_property (NULL, g_param_spec_enum ("border-style", |