[gtk+/wip/baedert/drawing: 132/262] Remove calls to gtk_widget_set_allocation



commit 73833fcc58c88550c917b34a7fd1b8b3b95ea595
Author: Timm Bäder <mail baedert org>
Date:   Fri May 5 19:18:53 2017 +0200

    Remove calls to gtk_widget_set_allocation
    
    gtk_widget_size_allocate_with_baselines does it automatically now.

 demos/gtk-demo/gtkfishbowl.c |    4 ++--
 gtk/gtkcalendar.c            |    1 -
 gtk/gtkeventbox.c            |    2 --
 gtk/gtkfixed.c               |    2 --
 gtk/gtkinvisible.c           |    2 +-
 gtk/gtklayout.c              |    2 --
 gtk/gtkmenu.c                |    2 --
 gtk/gtkpathbar.c             |    2 --
 gtk/gtkpopover.c             |    1 -
 gtk/gtktextview.c            |    2 --
 gtk/gtktoolitem.c            |    2 --
 gtk/gtktreeview.c            |    2 --
 gtk/gtkwindow.c              |    2 --
 13 files changed, 3 insertions(+), 23 deletions(-)
---
diff --git a/demos/gtk-demo/gtkfishbowl.c b/demos/gtk-demo/gtkfishbowl.c
index fd7b262..447610c 100644
--- a/demos/gtk-demo/gtkfishbowl.c
+++ b/demos/gtk-demo/gtkfishbowl.c
@@ -113,8 +113,6 @@ gtk_fishbowl_size_allocate (GtkWidget     *widget,
   GtkRequisition child_requisition;
   GList *children;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   for (children = priv->children; children; children = children->next)
     {
       child = children->data;
@@ -130,6 +128,8 @@ gtk_fishbowl_size_allocate (GtkWidget     *widget,
 
       gtk_widget_size_allocate (child->widget, &child_allocation);
     }
+
+  gtk_widget_set_clip (widget, allocation);
 }
 
 static double
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index d9baabd..3ab3726 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2060,7 +2060,6 @@ gtk_calendar_size_allocate (GtkWidget     *widget,
   gint calendar_xsep = calendar_get_xsep (calendar);
 
   get_component_paddings (calendar, &padding, NULL, NULL, NULL);
-  gtk_widget_set_allocation (widget, allocation);
 
   if (priv->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
     {
diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c
index f739bb7..87a670a 100644
--- a/gtk/gtkeventbox.c
+++ b/gtk/gtkeventbox.c
@@ -466,8 +466,6 @@ gtk_event_box_size_allocate (GtkWidget     *widget,
 
   bin = GTK_BIN (widget);
 
-  gtk_widget_set_allocation (widget, allocation);
-
   if (!gtk_widget_get_has_window (widget))
     {
       child_allocation.x = allocation->x;
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 2915676..7cea586 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -419,8 +419,6 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
   GtkRequisition child_requisition;
   GList *children;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   if (gtk_widget_get_has_window (widget))
     {
       if (gtk_widget_get_realized (widget))
diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c
index 16f5ef6..9478977 100644
--- a/gtk/gtkinvisible.c
+++ b/gtk/gtkinvisible.c
@@ -255,7 +255,7 @@ static void
 gtk_invisible_size_allocate (GtkWidget     *widget,
                              GtkAllocation *allocation)
 {
-  gtk_widget_set_allocation (widget, allocation);
+  gtk_widget_set_clip (widget, allocation);
 }
 
 
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 8680763..040e542 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -857,8 +857,6 @@ gtk_layout_size_allocate (GtkWidget     *widget,
   GtkLayoutPrivate *priv = layout->priv;
   GList *tmp_list;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   tmp_list = priv->children;
 
   while (tmp_list)
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index d384632..1aa1c75 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -2806,8 +2806,6 @@ gtk_menu_size_allocate (GtkWidget     *widget,
   menu_shell = GTK_MENU_SHELL (widget);
   priv = menu->priv;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   get_menu_padding (widget, &padding);
 
   g_free (priv->heights);
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index d4b0d09..dd90ee1 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -464,8 +464,6 @@ gtk_path_bar_size_allocate (GtkWidget     *widget,
   gint down_slider_offset = 0;
   GtkRequisition child_requisition;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   /* No path is set; we don't have to allocate anything. */
   if (path_bar->priv->button_list == NULL)
     {
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 44a0515..45707f1 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1354,7 +1354,6 @@ gtk_popover_size_allocate (GtkWidget     *widget,
   GtkAllocation child_clip;
   GtkAllocation clip = *allocation;
 
-  gtk_widget_set_allocation (widget, allocation);
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child)
     {
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 82a70a3..d9cc32d 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -4207,8 +4207,6 @@ gtk_text_view_size_allocate (GtkWidget *widget,
     widget_allocation.width != allocation->width ||
     widget_allocation.height != allocation->height;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   /* distribute width/height among child windows. Ensure all
    * windows get at least a 1x1 allocation.
    */
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 2365af8..eb12149 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -312,8 +312,6 @@ gtk_tool_item_size_allocate (GtkWidget     *widget,
   GtkAllocation child_allocation;
   GtkWidget *child;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   child = gtk_bin_get_child (GTK_BIN (widget));
   if (child && gtk_widget_get_visible (child))
     {
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a8a500f..b9af41b 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2610,8 +2610,6 @@ gtk_tree_view_size_allocate (GtkWidget     *widget,
   if (allocation->width != old_width)
     width_changed = TRUE;
 
-  gtk_widget_set_allocation (widget, allocation);
-
   /* We size-allocate the columns first because the width of the
    * tree view (used in updating the adjustments below) might change.
    */
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 7cba37a..12bfe4b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7109,8 +7109,6 @@ _gtk_window_set_allocation (GtkWindow           *window,
   g_assert (allocation != NULL);
   g_assert (allocation_out != NULL);
 
-  gtk_widget_set_allocation (widget, allocation);
-
   child_allocation.x = 0;
   child_allocation.y = 0;
   child_allocation.width = allocation->width;


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