[gimp/gtk3-port: 91/229] app: fix GimpOverlayDialog's minimum height



commit 0c2e921389fc7622d0bebbe31a9653fc188e295f
Author: Michael Natterer <mitch gimp org>
Date:   Fri Nov 19 13:56:37 2010 +0100

    app: fix GimpOverlayDialog's minimum height
    
    and avoid some code duplication by using the parent class' size
    negotiation code.

 app/widgets/gimpoverlaydialog.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/app/widgets/gimpoverlaydialog.c b/app/widgets/gimpoverlaydialog.c
index aea35d5..f6fcfbe 100644
--- a/app/widgets/gimpoverlaydialog.c
+++ b/app/widgets/gimpoverlaydialog.c
@@ -346,19 +346,15 @@ gimp_overlay_dialog_get_preferred_width (GtkWidget *widget,
                                          gint      *natural_width)
 {
   GimpOverlayDialog *dialog = GIMP_OVERLAY_DIALOG (widget);
-  GtkWidget         *child  = gtk_bin_get_child (GTK_BIN (widget));
   gint               border_width;
   gint               header_minimum;
   gint               header_natural;
   gint               action_minimum;
   gint               action_natural;
 
-  border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-
-  if (child && gtk_widget_get_visible (child))
-    gtk_widget_get_preferred_width (child, minimum_width, natural_width);
-  else
-    *minimum_width = *natural_width = 0;
+  GTK_WIDGET_CLASS (parent_class)->get_preferred_width (widget,
+                                                        minimum_width,
+                                                        natural_width);
 
   gtk_widget_get_preferred_width (dialog->header,
                                   &header_minimum, &header_natural);
@@ -375,7 +371,6 @@ gimp_overlay_dialog_get_preferred_height (GtkWidget *widget,
                                           gint      *natural_height)
 {
   GimpOverlayDialog *dialog = GIMP_OVERLAY_DIALOG (widget);
-  GtkWidget         *child  = gtk_bin_get_child (GTK_BIN (widget));
   gint               border_width;
   gint               header_minimum;
   gint               header_natural;
@@ -384,18 +379,17 @@ gimp_overlay_dialog_get_preferred_height (GtkWidget *widget,
 
   border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-  if (child && gtk_widget_get_visible (child))
-    gtk_widget_get_preferred_height (child, minimum_height, natural_height);
-  else
-    *minimum_height = *natural_height = 0;
+  GTK_WIDGET_CLASS (parent_class)->get_preferred_height (widget,
+                                                         minimum_height,
+                                                         natural_height);
 
   gtk_widget_get_preferred_height (dialog->header,
                                    &header_minimum, &header_natural);
   gtk_widget_get_preferred_height (dialog->action_area,
                                    &action_minimum, &action_natural);
 
-  *minimum_height += header_minimum + action_minimum + 4 * border_width;
-  *natural_height += header_natural + action_natural + 4 * border_width;
+  *minimum_height += header_minimum + action_minimum + 2 * border_width;
+  *natural_height += header_natural + action_natural + 2 * border_width;
 }
 
 static void


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