[gtk+] widget: Adapt _gtk_widget_get_preferred_size_for_size()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Adapt _gtk_widget_get_preferred_size_for_size()
- Date: Wed, 1 May 2013 15:46:49 +0000 (UTC)
commit 1349292e4744db7914cb98c407ccd3004eb50c5b
Author: Benjamin Otte <otte redhat com>
Date: Sat Apr 27 23:16:11 2013 +0200
widget: Adapt _gtk_widget_get_preferred_size_for_size()
... for baseline support byu taking two extra (possible NULL) arguments.
gtk/gtkmenubar.c | 2 +-
gtk/gtknotebook.c | 4 +++-
gtk/gtkpaned.c | 4 ++--
gtk/gtksizerequest.c | 31 ++++++++++++++++++++++---------
gtk/gtkwidgetprivate.h | 4 +++-
5 files changed, 31 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 62615cc..ec67a11 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 8e96865..3265f98 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 4d16e4f..3203cea 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 26a7efc..ed30f95 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 6ec03fd..7af552d 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]