diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-21 13:46:58 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-21 13:46:58 -0400 |
commit | 043ffd38bcc508db6813c4029203b8cd4ebbb967 (patch) | |
tree | d252f8ee00c736b3258ec0f6d7c735855192c01b | |
parent | 81371e7c795e7a530194a900424496f999b9bbe4 (diff) | |
download | gtk+-043ffd38bcc508db6813c4029203b8cd4ebbb967.tar.gz |
text: React to text attribute changes in css
Recompute the layout when the css style change
affects text attributes. This matches what we do
in GtkLabel, and without this, changing the
font-features-setting css property in the Inspector
does not have immediate effect.
-rw-r--r-- | gtk/gtktext.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 7f3d064a94..8f2745caf6 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -3488,11 +3488,13 @@ gtk_text_css_changed (GtkWidget *widget, gtk_text_update_cached_style_values (self); - if (change == NULL || - gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT | + if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT | GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_CONTENT)) - gtk_widget_queue_draw (GTK_WIDGET (self)); + gtk_widget_queue_draw (widget); + + if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_ATTRS)) + gtk_text_recompute (self); } static void |