[glom/gtkmm4v4] gtk4: EggSpreadTable: Adapt to changed size_allocate().



commit c0ce4ca79e0586edcaad83481da3b2d1c18e283d
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Nov 1 17:12:32 2017 +0100

    gtk4: EggSpreadTable: Adapt to changed size_allocate().

 .../eggspreadtable/eggspreadtable.c                |   16 +++++++++++-----
 .../eggspreadtable/eggspreadtablednd.c             |   14 ++++++++++----
 2 files changed, 21 insertions(+), 9 deletions(-)
---
diff --git a/glom/utility_widgets/eggspreadtable/eggspreadtable.c 
b/glom/utility_widgets/eggspreadtable/eggspreadtable.c
index 1fa9ae3..75acb7a 100644
--- a/glom/utility_widgets/eggspreadtable/eggspreadtable.c
+++ b/glom/utility_widgets/eggspreadtable/eggspreadtable.c
@@ -84,8 +84,10 @@ static void egg_spread_table_measure (GtkWidget      *widget,
                                       int            *natural,
                                       int            *minimum_baseline,
                                       int            *natural_baseline);
-static void egg_spread_table_size_allocate        (GtkWidget           *widget,
-                                                  GtkAllocation       *allocation);
+static void egg_spread_table_size_allocate (GtkWidget     *widget,
+                                            const GtkAllocation *allocation,
+                                            int                  baseline,
+                                            GtkAllocation       *out_clip);
 
 /* GtkContainerClass */
 static void egg_spread_table_add                  (GtkContainer        *container,
@@ -598,12 +600,16 @@ allocate_child (EggSpreadTable *table,
       child_allocation.height = item_size;
     }
 
-  gtk_widget_size_allocate (child, &child_allocation);
+  gint baseline = gtk_widget_get_allocated_baseline (child);
+  GtkAllocation clip;
+  gtk_widget_size_allocate (child, &child_allocation, baseline, &clip);
 }
 
 static void
 egg_spread_table_size_allocate (GtkWidget     *widget,
-                               GtkAllocation *allocation)
+                                const GtkAllocation *allocation,
+                                int                  baseline,
+                                GtkAllocation       *out_clip)
 {
   EggSpreadTable        *table = EGG_SPREAD_TABLE (widget);
   EggSpreadTablePrivate *priv = table->priv;
@@ -616,7 +622,7 @@ egg_spread_table_size_allocate (GtkWidget     *widget,
   gint                   line_spacing;
   gint                   item_spacing;
 
-  GTK_WIDGET_CLASS (egg_spread_table_parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (egg_spread_table_parent_class)->size_allocate (widget, allocation, baseline, out_clip);
 
   if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     full_thickness = allocation->height;
diff --git a/glom/utility_widgets/eggspreadtable/eggspreadtablednd.c 
b/glom/utility_widgets/eggspreadtable/eggspreadtablednd.c
index 59250e4..1d47e3d 100644
--- a/glom/utility_widgets/eggspreadtable/eggspreadtablednd.c
+++ b/glom/utility_widgets/eggspreadtable/eggspreadtablednd.c
@@ -45,7 +45,9 @@ static void          egg_spread_table_dnd_realize            (GtkWidget
 static gboolean      egg_spread_table_dnd_draw               (GtkWidget *widget,
                     cairo_t *cr);
 static void          egg_spread_table_dnd_size_allocate      (GtkWidget         *widget,
-                                                             GtkAllocation     *allocation);
+                                                             const GtkAllocation *allocation,
+                                                             int                  baseline,
+                                                             GtkAllocation       *out_clip);
 
 /* GtkWidgetClass drag-dest */
 static void          egg_spread_table_dnd_drag_leave         (GtkWidget         *widget,
@@ -447,7 +449,9 @@ allocate_child (EggSpreadTableDnd *table,
       child_allocation.height = item_size;
     }
 
-  gtk_widget_size_allocate (child, &child_allocation);
+  gint baseline = gtk_widget_get_allocated_baseline (child);
+  GtkAllocation clip;
+  gtk_widget_size_allocate (child, &child_allocation, baseline, &clip);
 }
 
 static void
@@ -496,7 +500,9 @@ get_spread_table_dimensions (EggSpreadTableDnd *spread_table,
 
 static void
 egg_spread_table_dnd_size_allocate (GtkWidget         *widget,
-                                   GtkAllocation     *allocation)
+                                    const GtkAllocation *allocation,
+                                    int                  baseline,
+                                    GtkAllocation       *out_clip)
 {
   EggSpreadTableDnd        *table = EGG_SPREAD_TABLE_DND (widget);
   GList                    *list, *children;
@@ -515,7 +521,7 @@ egg_spread_table_dnd_size_allocate (GtkWidget         *widget,
   /* Skip the EggSpreadTableClass allocator, chain up to it's parent to resize
    * the GdkWindow properly */
   parent_parent_class = g_type_class_peek_parent (egg_spread_table_dnd_parent_class);
-  parent_parent_class->size_allocate (widget, allocation);
+  parent_parent_class->size_allocate (widget, allocation, baseline, out_clip);
 
   get_spread_table_dimensions (table, -1, &line_spacing, &item_spacing, &full_thickness, &line_thickness);
   lines       = egg_spread_table_get_lines (EGG_SPREAD_TABLE (table));


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