summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-06-01 23:37:21 +0200
committerBenjamin Otte <otte@redhat.com>2011-06-02 00:07:25 +0200
commit352569298a739f897f17b36e084f129f2c212a10 (patch)
tree251158669a49f36e0e4deaae4a18251429367ad5 /gtk/gtknotebook.c
parent4d78e9c8afce185cd3725479ed5e2e6d57f813c1 (diff)
downloadgtk+-352569298a739f897f17b36e084f129f2c212a10.tar.gz
notebook: Implement height_for_width and width_for_height getters
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index f8457b592d..88835d3e34 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -332,6 +332,16 @@ static void gtk_notebook_get_preferred_width (GtkWidget *widget,
static void gtk_notebook_get_preferred_height(GtkWidget *widget,
gint *minimum,
gint *natural);
+static void gtk_notebook_get_preferred_width_for_height
+ (GtkWidget *widget,
+ gint height,
+ gint *minimum,
+ gint *natural);
+static void gtk_notebook_get_preferred_height_for_width
+ (GtkWidget *widget,
+ gint width,
+ gint *minimum,
+ gint *natural);
static void gtk_notebook_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gtk_notebook_draw (GtkWidget *widget,
@@ -635,6 +645,8 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->unrealize = gtk_notebook_unrealize;
widget_class->get_preferred_width = gtk_notebook_get_preferred_width;
widget_class->get_preferred_height = gtk_notebook_get_preferred_height;
+ widget_class->get_preferred_width_for_height = gtk_notebook_get_preferred_width_for_height;
+ widget_class->get_preferred_height_for_width = gtk_notebook_get_preferred_height_for_width;
widget_class->size_allocate = gtk_notebook_size_allocate;
widget_class->draw = gtk_notebook_draw;
widget_class->button_press_event = gtk_notebook_button_press;
@@ -2336,6 +2348,23 @@ gtk_notebook_size_request (GtkWidget *widget,
}
}
+static void
+gtk_notebook_get_preferred_width_for_height (GtkWidget *widget,
+ gint height,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_notebook_size_request (widget, GTK_ORIENTATION_HORIZONTAL, height, minimum, natural);
+}
+
+static void
+gtk_notebook_get_preferred_height_for_width (GtkWidget *widget,
+ gint width,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_notebook_size_request (widget, GTK_ORIENTATION_VERTICAL, width, minimum, natural);
+}
static void
gtk_notebook_get_preferred_width (GtkWidget *widget,