[gtk+] paned: Implement get_width_for_height() and get_height_for_width()



commit 392c0dc145bb18765ec7f2cc1548ba76de77e84b
Author: Benjamin Otte <otte redhat com>
Date:   Mon Apr 18 01:41:35 2011 +0200

    paned: Implement get_width_for_height() and get_height_for_width()

 gtk/gtkpaned.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index f50bc64..f3e8d58 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)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]