summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-04-22 17:37:05 -0400
committerBenjamin Otte <otte@redhat.com>2013-04-22 18:29:01 -0400
commit3450388ff03794ef4c4e7c24e91bfb40798dbec5 (patch)
tree5e1ac6eb992437e320d57f466e481e831b9d1b53 /gtk/gtknotebook.c
parent009aadf378150c32aed9347bbffffda2ca0af6f2 (diff)
downloadgtk+-3450388ff03794ef4c4e7c24e91bfb40798dbec5.tar.gz
sizerequest: Split out a common function
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 5f0ce009a8..2ac7936af3 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2215,25 +2215,6 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook *notebook,
}
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
get_padding_and_border (GtkNotebook *notebook,
GtkBorder *border)
{
@@ -2282,11 +2263,11 @@ gtk_notebook_size_request (GtkWidget *widget,
if (gtk_widget_get_visible (page->child))
{
vis_pages++;
- get_preferred_size_for_size (page->child,
- orientation,
- size,
- &child_minimum,
- &child_natural);
+ _gtk_widget_get_preferred_size_for_size (page->child,
+ orientation,
+ size,
+ &child_minimum,
+ &child_natural);
*minimum = MAX (*minimum, child_minimum);
*natural = MAX (*natural, child_natural);