[gimp] Chain up in some size-allocate implementations



commit 53f34ebc0b10fd0688d78a2524a7caaa657f3c11
Author: Timm Bäder <mail baedert org>
Date:   Fri Sep 9 18:32:03 2016 +0200

    Chain up in some size-allocate implementations
    
    The default implementation does just the right thing for most widgets.

 app/widgets/gimpcircle.c       |    2 +-
 app/widgets/gimpoverlaybox.c   |    9 +--------
 app/widgets/gimpview.c         |    2 +-
 libgimpwidgets/gimpcolorarea.c |    3 +--
 libgimpwidgets/gimpframe.c     |    2 +-
 libgimpwidgets/gimpruler.c     |    2 +-
 modules/gimpcolorwheel.c       |    2 +-
 7 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/app/widgets/gimpcircle.c b/app/widgets/gimpcircle.c
index 742aa44..cb0943a 100644
--- a/app/widgets/gimpcircle.c
+++ b/app/widgets/gimpcircle.c
@@ -334,7 +334,7 @@ gimp_circle_size_allocate (GtkWidget     *widget,
 {
   GimpCircle *circle = GIMP_CIRCLE (widget);
 
-  gtk_widget_set_allocation (widget, allocation);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   if (gtk_widget_get_realized (widget))
     gdk_window_move_resize (circle->priv->event_window,
diff --git a/app/widgets/gimpoverlaybox.c b/app/widgets/gimpoverlaybox.c
index 604f73b..c3fedec 100644
--- a/app/widgets/gimpoverlaybox.c
+++ b/app/widgets/gimpoverlaybox.c
@@ -210,14 +210,7 @@ gimp_overlay_box_size_allocate (GtkWidget     *widget,
   GimpOverlayBox *box = GIMP_OVERLAY_BOX (widget);
   GList          *list;
 
-  gtk_widget_set_allocation (widget, allocation);
-
-  if (gtk_widget_get_realized (widget))
-    gdk_window_move_resize (gtk_widget_get_window (widget),
-                            allocation->x,
-                            allocation->y,
-                            allocation->width,
-                            allocation->height);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   for (list = box->children; list; list = g_list_next (list))
     gimp_overlay_child_size_allocate (box, list->data);
diff --git a/app/widgets/gimpview.c b/app/widgets/gimpview.c
index d85cb30..123844f 100644
--- a/app/widgets/gimpview.c
+++ b/app/widgets/gimpview.c
@@ -376,7 +376,7 @@ gimp_view_size_allocate (GtkWidget     *widget,
   allocation->width  = width;
   allocation->height = height;
 
-  gtk_widget_set_allocation (widget, allocation);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   if (gtk_widget_get_realized (widget))
     gdk_window_move_resize (view->event_window,
diff --git a/libgimpwidgets/gimpcolorarea.c b/libgimpwidgets/gimpcolorarea.c
index ee88f94..7a38f20 100644
--- a/libgimpwidgets/gimpcolorarea.c
+++ b/libgimpwidgets/gimpcolorarea.c
@@ -343,8 +343,7 @@ gimp_color_area_size_allocate (GtkWidget     *widget,
 {
   GimpColorArea *area = GIMP_COLOR_AREA (widget);
 
-  if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
-    GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   if (allocation->width  != area->width ||
       allocation->height != area->height)
diff --git a/libgimpwidgets/gimpframe.c b/libgimpwidgets/gimpframe.c
index 43436b9..607f355 100644
--- a/libgimpwidgets/gimpframe.c
+++ b/libgimpwidgets/gimpframe.c
@@ -149,7 +149,7 @@ gimp_frame_size_allocate (GtkWidget     *widget,
   GtkWidget     *child        = gtk_bin_get_child (GTK_BIN (widget));
   GtkAllocation  child_allocation;
 
-  gtk_widget_set_allocation (widget, allocation);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   gimp_frame_child_allocate (frame, &child_allocation);
 
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index 028691b..c5dbd0e 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -863,7 +863,7 @@ gimp_ruler_size_allocate (GtkWidget     *widget,
   resized = (widget_allocation.width  != allocation->width ||
              widget_allocation.height != allocation->height);
 
-  gtk_widget_set_allocation (widget, allocation);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   if (gtk_widget_get_realized (widget))
     {
diff --git a/modules/gimpcolorwheel.c b/modules/gimpcolorwheel.c
index eff3928..e56f85a 100644
--- a/modules/gimpcolorwheel.c
+++ b/modules/gimpcolorwheel.c
@@ -353,7 +353,7 @@ gimp_color_wheel_size_allocate (GtkWidget     *widget,
   gint                   focus_width;
   gint                   focus_pad;
 
-  gtk_widget_set_allocation (widget, allocation);
+  GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
 
   gtk_widget_style_get (widget,
                         "focus-line-width", &focus_width,


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