diff options
author | Benjamin Otte <otte@redhat.com> | 2013-04-22 17:37:05 -0400 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2013-04-22 18:29:01 -0400 |
commit | 3450388ff03794ef4c4e7c24e91bfb40798dbec5 (patch) | |
tree | 5e1ac6eb992437e320d57f466e481e831b9d1b53 /gtk/gtkmenubar.c | |
parent | 009aadf378150c32aed9347bbffffda2ca0af6f2 (diff) | |
download | gtk+-3450388ff03794ef4c4e7c24e91bfb40798dbec5.tar.gz |
sizerequest: Split out a common function
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r-- | gtk/gtkmenubar.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index d337d712ae..62615cc711 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -50,6 +50,7 @@ #include "gtkintl.h" #include "gtkprivate.h" #include "gtktypebuiltins.h" +#include "gtkwidgetprivate.h" /* Properties */ enum { @@ -309,25 +310,6 @@ gtk_menu_bar_get_property (GObject *object, } static void -get_preferred_size_for_size (GtkWidget *widget, - GtkOrientation orientation, - gint size, - gint *minimum, - gint *natural) -{ - if (orientation == GTK_ORIENTATION_HORIZONTAL) - if (size < 0) - gtk_widget_get_preferred_width (widget, minimum, natural); - else - gtk_widget_get_preferred_width_for_height (widget, size, minimum, natural); - else - if (size < 0) - gtk_widget_get_preferred_height (widget, minimum, natural); - else - gtk_widget_get_preferred_height_for_width (widget, size, minimum, natural); -} - -static void gtk_menu_bar_size_request (GtkWidget *widget, GtkOrientation orientation, gint size, @@ -374,7 +356,7 @@ gtk_menu_bar_size_request (GtkWidget *widget, if (gtk_widget_get_visible (child)) { - get_preferred_size_for_size (child, orientation, size, &child_minimum, &child_natural); + _gtk_widget_get_preferred_size_for_size (child, orientation, size, &child_minimum, &child_natural); if (use_toggle_size) { |