}
static void
-ev_view_presentation_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
+ev_view_presentation_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
{
- requisition->width = 0;
- requisition->height = 0;
+ *minimum = *natural = 0;
+}
+
+static void
+ev_view_presentation_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ *minimum = *natural = 0;
}
static void
gobject_class->dispose = ev_view_presentation_dispose;
- widget_class->size_request = ev_view_presentation_size_request;
+ widget_class->get_preferred_width = ev_view_presentation_get_preferred_width;
+ widget_class->get_preferred_height = ev_view_presentation_get_preferred_height;
widget_class->realize = ev_view_presentation_realize;
widget_class->draw = ev_view_presentation_draw;
widget_class->key_press_event = ev_view_presentation_key_press_event;
*requisition = view->requisition;
}
+static void
+ev_view_get_preferred_width (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ ev_view_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.width;
+}
+
+static void
+ev_view_get_preferred_height (GtkWidget *widget,
+ gint *minimum,
+ gint *natural)
+{
+ GtkRequisition requisition;
+
+ ev_view_size_request (widget, &requisition);
+
+ *minimum = *natural = requisition.height;
+}
+
static void
ev_view_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
form_field_mapping,
field, &view_area);
- gtk_widget_size_request (child, &child_requisition);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
if (child_requisition.width != view_area.width ||
child_requisition.height != view_area.height)
gtk_widget_set_size_request (child, view_area.width, view_area.height);
widget_class->focus_in_event = ev_view_focus_in;
widget_class->focus_out_event = ev_view_focus_out;
widget_class->get_accessible = ev_view_get_accessible;
- widget_class->size_request = ev_view_size_request;
+ widget_class->get_preferred_width = ev_view_get_preferred_width;
+ widget_class->get_preferred_height = ev_view_get_preferred_height;
widget_class->size_allocate = ev_view_size_allocate;
widget_class->scroll_event = ev_view_scroll_event;
widget_class->enter_notify_event = ev_view_enter_notify_event;