mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
label: Parse new pango attributes
Support allow-breaks and show attributes. These will be in pango 1.44
This commit is contained in:
parent
c179fce6c7
commit
f1c7803f80
@ -1543,6 +1543,14 @@ attribute_from_text (GtkBuilder *builder,
|
||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
|
||||
attribute = pango_attr_background_alpha_new ((guint16)g_value_get_int (&val));
|
||||
break;
|
||||
case PANGO_ATTR_ALLOW_BREAKS:
|
||||
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
|
||||
attribute = pango_attr_allow_breaks_new (g_value_get_boolean (&val));
|
||||
break;
|
||||
case PANGO_ATTR_SHOW:
|
||||
if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_SHOW_FLAGS, value, &val, error))
|
||||
attribute = pango_attr_show_new (g_value_get_flags (&val));
|
||||
break;
|
||||
case PANGO_ATTR_INVALID:
|
||||
default:
|
||||
break;
|
||||
|
@ -20,6 +20,8 @@
|
||||
<attribute name="underline-color" value="green"/>
|
||||
<attribute name="strikethrough-color" value="purple"/>
|
||||
<attribute name="scale" value="1.5"/>
|
||||
<attribute name="allow-breaks" value="true"/>
|
||||
<attribute name="show" value="spaces|line-breaks"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</interface>
|
||||
|
Loading…
Reference in New Issue
Block a user