diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-24 12:47:12 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-25 14:57:13 -0400 |
commit | b9cad7cc545cd82dca4c9d11085d6b7026b22038 (patch) | |
tree | 7eb90efa5588f0098f97318a41749331da86d411 /gtk/gtktextbuffer.c | |
parent | 357b97b5a6eda3c69b256ea270dad7e7c7f4dc99 (diff) | |
download | gtk+-b9cad7cc545cd82dca4c9d11085d6b7026b22038.tar.gz |
textview: Implement new pango attributesnew-pango-attributes
Implement the word and sentence attributes.
Diffstat (limited to 'gtk/gtktextbuffer.c')
-rw-r--r-- | gtk/gtktextbuffer.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index fd457df699..67d1e47056 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -4581,8 +4581,20 @@ insert_tags_for_attributes (GtkTextBuffer *buffer, gtk_text_buffer_apply_tag (buffer, tag, start, end); \ } - fg_alpha = bg_alpha = 1.; +#define VOID_ATTR(attr_name) \ + { \ + tag = gtk_text_tag_table_lookup (table, #attr_name); \ + if (!tag) \ + { \ + tag = gtk_text_tag_new (#attr_name); \ + g_object_set (tag, #attr_name, TRUE, NULL); \ + gtk_text_tag_table_add (table, tag); \ + g_object_unref (tag); \ + } \ + gtk_text_buffer_apply_tag (buffer, tag, start, end); \ + } + fg_alpha = bg_alpha = 1.; attrs = pango_attr_iterator_get_attrs (iter); for (l = attrs; l; l = l->next) { @@ -4716,6 +4728,14 @@ insert_tags_for_attributes (GtkTextBuffer *buffer, INT_ATTR (text_transform); break; + case PANGO_ATTR_WORD: + VOID_ATTR (word); + break; + + case PANGO_ATTR_SENTENCE: + VOID_ATTR (sentence); + break; + case PANGO_ATTR_SHAPE: case PANGO_ATTR_ABSOLUTE_SIZE: case PANGO_ATTR_GRAVITY: |