[gimp/gtk3-port: 127/247] app: fix GimpOverlayDialog's minimum height
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 127/247] app: fix GimpOverlayDialog's minimum height
- Date: Sat, 5 Mar 2011 20:42:52 +0000 (UTC)
commit 8ee2faebbcf3524e1c5036856f899e5c29a7b968
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 | 27 ++++++++++-----------------
1 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/app/widgets/gimpoverlaydialog.c b/app/widgets/gimpoverlaydialog.c
index 768b26b..dd89283 100644
--- a/app/widgets/gimpoverlaydialog.c
+++ b/app/widgets/gimpoverlaydialog.c
@@ -149,23 +149,18 @@ 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 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->action_area,
&action_minimum, &action_natural);
- *minimum_width = MAX (*minimum_width, action_minimum) + 2 * border_width;
- *natural_width = MAX (*natural_width, action_natural) + 2 * border_width;
+ *minimum_width = MAX (*minimum_width, action_minimum);
+ *natural_width = MAX (*natural_width, action_natural);
}
static void
@@ -174,23 +169,21 @@ 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 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_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->action_area,
&action_minimum, &action_natural);
- *minimum_height = MAX (*minimum_height, action_minimum) + 3 * border_width;
- *natural_height = MAX (*natural_height, action_natural) + 3 * border_width;
+ *minimum_height += action_minimum + border_width;
+ *natural_height += action_natural + border_width;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]