[gtk+/wip/baedert/drawing: 333/371] widget: Always pass on baselines



commit 059a34a17724605feda29f6bd889e72da9b73289
Author: Timm Bäder <mail baedert org>
Date:   Tue Jul 4 19:00:00 2017 +0200

    widget: Always pass on baselines

 gtk/gtksizerequest.c |    6 ------
 gtk/gtkwidget.c      |   11 ++---------
 2 files changed, 2 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 0b1564e..9d991b1 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -299,12 +299,6 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
              min_baseline = -1;
              nat_baseline = -1;
            }
-         else if (gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
-           {
-             /* Ignore requested baseline for non-aligned widgets */
-             min_baseline = -1;
-             nat_baseline = -1;
-           }
           else if (min_baseline > reported_min_size ||
                    nat_baseline > reported_nat_size ||
                    min_baseline < 0 ||
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 4cb273a..ea95498 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3793,6 +3793,8 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
   priv->last_child = NULL;
   priv->prev_sibling = NULL;
   priv->next_sibling = NULL;
+  priv->allocated_baseline = -1;
+  priv->allocated_size_baseline = -1;
 
   priv->sensitive = TRUE;
   priv->redraw_on_alloc = TRUE;
@@ -5366,9 +5368,6 @@ invalidate:
  * margins, and applying the widget’s #GtkWidget:halign and
  * #GtkWidget:valign properties.
  *
- * If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
- * baseline argument is ignored and -1 is used instead.
- *
  * Since: 3.10
  **/
 void
@@ -5436,12 +5435,6 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
     }
 #endif /* G_ENABLE_DEBUG */
 
-  /* Never pass a baseline to a child unless it requested it.
-     This means containers don't have to manually check for this. */
-  if (baseline != -1 &&
-      gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
-    baseline = -1;
-
   alloc_needed = priv->alloc_needed;
   /* Preserve request/allocate ordering */
   priv->alloc_needed = FALSE;


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