[gtk] text: Propagate pango attributes to placeholder



commit dfcc40ef9a5963130fa9ab0a114817a47c5e20fd
Author: Timm Bäder <mail baedert org>
Date:   Sun Oct 20 08:43:50 2019 +0200

    text: Propagate pango attributes to placeholder
    
    Not sure if this is really always wanted or whether we need to filter
    the attributes, or even create a separate property for them.

 gtk/gtktext.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index f4b15872b1..698b1421eb 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -6467,6 +6467,7 @@ gtk_text_set_placeholder_text (GtkText    *self,
                                         "xalign", 0.0f,
                                         "ellipsize", PANGO_ELLIPSIZE_END,
                                         NULL);
+      gtk_label_set_attributes (GTK_LABEL (priv->placeholder), priv->attrs);
       gtk_widget_insert_after (priv->placeholder, GTK_WIDGET (self), NULL);
     }
   else
@@ -6621,6 +6622,9 @@ gtk_text_set_attributes (GtkText       *self,
     pango_attr_list_unref (priv->attrs);
   priv->attrs = attrs;
 
+  if (priv->placeholder)
+    gtk_label_set_attributes (GTK_LABEL (priv->placeholder), attrs);
+
   g_object_notify_by_pspec (G_OBJECT (self), text_props[PROP_ATTRIBUTES]);
 
   gtk_text_recompute (self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]