summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-05-27 11:44:33 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-05-27 11:44:33 +0000
commitc9785c4cd33cf774ff01e49ec697ec30701df399 (patch)
treedbc1332f9cb654a42ce50a8b19c4c123ee512a2d
parent4362f7e6e253becf4bc8d42f33dc8d8cb29827f3 (diff)
parent9f93883dc9a93785e77a7f16501c41270ef9018e (diff)
downloadgtk+-c9785c4cd33cf774ff01e49ec697ec30701df399.tar.gz
Merge branch 'placeholder-alignment' into 'master'
text: Propagate xalign to the placeholder Closes #3979 See merge request GNOME/gtk!3604
-rw-r--r--gtk/gtktext.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index bf9d8e2c84..2416e980f9 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -5914,6 +5914,9 @@ gtk_text_set_alignment (GtkText *self,
{
priv->xalign = xalign;
gtk_text_recompute (self);
+ if (priv->placeholder)
+ gtk_label_set_xalign (GTK_LABEL (priv->placeholder), xalign);
+
g_object_notify (G_OBJECT (self), "xalign");
}
}
@@ -6638,7 +6641,7 @@ gtk_text_set_placeholder_text (GtkText *self,
priv->placeholder = g_object_new (GTK_TYPE_LABEL,
"label", text,
"css-name", "placeholder",
- "xalign", 0.0f,
+ "xalign", priv->xalign,
"ellipsize", PANGO_ELLIPSIZE_END,
NULL);
gtk_label_set_attributes (GTK_LABEL (priv->placeholder), priv->attrs);