diff options
author | Benjamin Otte <otte@redhat.com> | 2013-04-27 23:16:11 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2013-05-01 16:41:11 +0200 |
commit | 1349292e4744db7914cb98c407ccd3004eb50c5b (patch) | |
tree | 0a15850ec45ae75f2db164426b44e7d78c75d9b6 /gtk | |
parent | 8f0659071278ae8222f154bd03d4690b275b6ff1 (diff) | |
download | gtk+-1349292e4744db7914cb98c407ccd3004eb50c5b.tar.gz |
widget: Adapt _gtk_widget_get_preferred_size_for_size()
... for baseline support byu taking two extra (possible NULL) arguments.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkmenubar.c | 2 | ||||
-rw-r--r-- | gtk/gtknotebook.c | 4 | ||||
-rw-r--r-- | gtk/gtkpaned.c | 4 | ||||
-rw-r--r-- | gtk/gtksizerequest.c | 31 | ||||
-rw-r--r-- | gtk/gtkwidgetprivate.h | 4 |
5 files changed, 31 insertions, 14 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index 62615cc711..ec67a11f99 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -356,7 +356,7 @@ gtk_menu_bar_size_request (GtkWidget *widget, if (gtk_widget_get_visible (child)) { - _gtk_widget_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, NULL, NULL); if (use_toggle_size) { diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 8e968657fc..3265f982e9 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2267,7 +2267,9 @@ gtk_notebook_size_request (GtkWidget *widget, orientation, size, &child_minimum, - &child_natural); + &child_natural, + NULL, + NULL); *minimum = MAX (*minimum, child_minimum); *natural = MAX (*natural, child_natural); diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 4d16e4fe02..3203cea0ca 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -885,7 +885,7 @@ gtk_paned_get_preferred_size (GtkWidget *widget, if (priv->child1 && gtk_widget_get_visible (priv->child1)) { - _gtk_widget_get_preferred_size_for_size (priv->child1, orientation, size, &child_min, &child_nat); + _gtk_widget_get_preferred_size_for_size (priv->child1, orientation, size, &child_min, &child_nat, NULL, NULL); if (priv->child1_shrink && priv->orientation == orientation) *minimum = 0; else @@ -895,7 +895,7 @@ gtk_paned_get_preferred_size (GtkWidget *widget, if (priv->child2 && gtk_widget_get_visible (priv->child2)) { - _gtk_widget_get_preferred_size_for_size (priv->child2, orientation, size, &child_min, &child_nat); + _gtk_widget_get_preferred_size_for_size (priv->child2, orientation, size, &child_min, &child_nat, NULL, NULL); if (priv->orientation == orientation) { diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 26a7efc769..ed30f9515d 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -858,20 +858,33 @@ _gtk_widget_get_preferred_size_for_size (GtkWidget *widget, GtkOrientation orientation, gint size, gint *minimum, - gint *natural) + gint *natural, + gint *minimum_baseline, + gint *natural_baseline) { g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (size >= -1); 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); + { + if (size < 0) + gtk_widget_get_preferred_width (widget, minimum, natural); + else + gtk_widget_get_preferred_width_for_height (widget, size, minimum, natural); + + if (minimum_baseline) + *minimum_baseline = -1; + if (natural_baseline) + *natural_baseline = -1; + } else - if (size < 0) - gtk_widget_get_preferred_height (widget, minimum, natural); - else - gtk_widget_get_preferred_height_for_width (widget, size, minimum, natural); + { + gtk_widget_get_preferred_height_and_baseline_for_width (widget, + size, + minimum, + natural, + minimum_baseline, + natural_baseline); + } } diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index 6ec03fd9b4..7af552d51e 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -76,7 +76,9 @@ void _gtk_widget_get_preferred_size_for_size (GtkWidget *widget, GtkOrientation orientation, gint size, gint *minimum, - gint *natural); + gint *natural, + gint *minimum_baseline, + gint *natural_baseline); gboolean _gtk_widget_has_baseline_support (GtkWidget *widget); gboolean _gtk_widget_get_translation_to_window (GtkWidget *widget, |