diff options
author | Benjamin Otte <otte@redhat.com> | 2011-04-18 01:41:35 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-04-19 22:18:17 +0200 |
commit | 392c0dc145bb18765ec7f2cc1548ba76de77e84b (patch) | |
tree | e303558db2de13df60fdfe1b1d0b6df79a1446db /gtk/gtkpaned.c | |
parent | a45c59954390dc9508f72f58608ed3c99a76a317 (diff) | |
download | gtk+-392c0dc145bb18765ec7f2cc1548ba76de77e84b.tar.gz |
paned: Implement get_width_for_height() and get_height_for_width()
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r-- | gtk/gtkpaned.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index f50bc64fbe..f3e8d584a6 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -174,6 +174,16 @@ static void gtk_paned_get_preferred_width (GtkWidget *widget, static void gtk_paned_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural); +static void gtk_paned_get_preferred_width_for_height + (GtkWidget *widget, + gint height, + gint *minimum, + gint *natural); +static void gtk_paned_get_preferred_height_for_width + (GtkWidget *widget, + gint width, + gint *minimum, + gint *natural); static void gtk_paned_size_allocate (GtkWidget *widget, GtkAllocation *allocation); @@ -284,6 +294,8 @@ gtk_paned_class_init (GtkPanedClass *class) widget_class->get_preferred_width = gtk_paned_get_preferred_width; widget_class->get_preferred_height = gtk_paned_get_preferred_height; + widget_class->get_preferred_width_for_height = gtk_paned_get_preferred_width_for_height; + widget_class->get_preferred_height_for_width = gtk_paned_get_preferred_height_for_width; widget_class->size_allocate = gtk_paned_size_allocate; widget_class->realize = gtk_paned_realize; widget_class->unrealize = gtk_paned_unrealize; @@ -933,6 +945,24 @@ gtk_paned_get_preferred_height (GtkWidget *widget, } static void +gtk_paned_get_preferred_width_for_height (GtkWidget *widget, + gint height, + gint *minimum, + gint *natural) +{ + gtk_paned_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, height, minimum, natural); +} + +static void +gtk_paned_get_preferred_height_for_width (GtkWidget *widget, + gint width, + gint *minimum, + gint *natural) +{ + gtk_paned_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, width, minimum, natural); +} + +static void flip_child (GtkWidget *widget, GtkAllocation *child_pos) { |