label: Parse new pango attributes

Support allow-breaks and show attributes.
These will be in pango 1.44
This commit is contained in:
Matthias Clasen 2019-07-27 00:02:08 -04:00
parent c179fce6c7
commit f1c7803f80
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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>