Commit 35256929 authored by Benjamin Otte's avatar Benjamin Otte

notebook: Implement height_for_width and width_for_height getters

parent 4d78e9c8
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment