diff options
author | Benjamin Otte <otte@redhat.com> | 2011-04-25 01:48:59 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-05-03 15:38:43 +0200 |
commit | 69300df1fc94e6dbaea0f9c2c9215eb45d345a80 (patch) | |
tree | 7c5c3cfa46966438ff0821f071978c6c203775a4 /gtk/gtklabel.c | |
parent | 1e1cca8912c41d70ca994addab6ce0b00f8354bc (diff) | |
download | gtk+-69300df1fc94e6dbaea0f9c2c9215eb45d345a80.tar.gz |
label: Allow using more underline modes
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r-- | gtk/gtklabel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 2fb4dc9f0e..3b6504e346 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1346,8 +1346,16 @@ attribute_from_text (GtkBuilder *builder, attribute = pango_attr_stretch_new (g_value_get_enum (&val)); break; case PANGO_ATTR_UNDERLINE: - if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error)) - attribute = pango_attr_underline_new (g_value_get_boolean (&val)); + if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_UNDERLINE, value, &val, NULL)) + attribute = pango_attr_underline_new (g_value_get_enum (&val)); + else + { + /* XXX: allow boolean for backwards compat, so ignore error */ + /* Deprecate this somehow */ + g_value_unset (&val); + if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error)) + attribute = pango_attr_underline_new (g_value_get_boolean (&val)); + } break; case PANGO_ATTR_STRIKETHROUGH: if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error)) |