entry: Ignore the baseline when centering
authorMatthias Clasen <mclasen@redhat.com>
Sat, 29 Apr 2023 13:20:07 +0000 (09:20 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 29 Apr 2023 13:52:34 +0000 (09:52 -0400)
GtkEntry was always placing its text on the baseline,
even when the valign said something else.

gtk/gtkentry.c

index 0b76c9de79596b57596b42ec7c5ebeb802eaad78..69af1b00f251a7d63c637be123e4ea99a9de3436 100644 (file)
@@ -1706,6 +1706,9 @@ gtk_entry_size_allocate (GtkWidget *widget,
   text_alloc.width = width;
   text_alloc.height = height;
 
+  if (gtk_widget_get_valign (widget)  != GTK_ALIGN_BASELINE)
+    baseline = -1;
+
   for (i = 0; i < MAX_ICONS; i++)
     {
       EntryIconInfo *icon_info = priv->icons[i];