text: Make the placeholder non-intrusive

We never want to let the placeholder cause
the widget to grow, so set its max-width-chars
to a small value to make it ellipsize.
This commit is contained in:
Matthias Clasen
2023-06-04 21:45:59 -04:00
parent 18482ac484
commit e16f71304f

View File

@@ -6717,6 +6717,7 @@ gtk_text_set_placeholder_text (GtkText *self,
"css-name", "placeholder",
"xalign", priv->xalign,
"ellipsize", PANGO_ELLIPSIZE_END,
"max-width-chars", 3,
NULL);
gtk_label_set_attributes (GTK_LABEL (priv->placeholder), priv->attrs);
gtk_widget_insert_after (priv->placeholder, GTK_WIDGET (self), NULL);