text: Propagate pango attributes to placeholder
authorTimm Bäder <mail@baedert.org>
Sun, 20 Oct 2019 06:43:50 +0000 (08:43 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 22 Oct 2019 07:37:08 +0000 (09:37 +0200)
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

index f4b15872b1a2c987d5075b05502b309bc0eb7dfb..698b1421eb426f36be859e86eebbaf9f3c188da2 100644 (file)
@@ -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);