[evolution/gtk3] Replace size_request vfunc with get_preferred_height/width
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gtk3] Replace size_request vfunc with get_preferred_height/width
- Date: Fri, 10 Dec 2010 12:35:16 +0000 (UTC)
commit 344a3d41c985aa5a60e996d272681178ebf307fb
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Fri Dec 10 13:15:27 2010 +0100
Replace size_request vfunc with get_preferred_height/width
widgets/misc/e-calendar.c | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
---
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c
index d835ba8..7a72a43 100644
--- a/widgets/misc/e-calendar.c
+++ b/widgets/misc/e-calendar.c
@@ -71,6 +71,12 @@ static void e_calendar_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void e_calendar_size_request (GtkWidget *widget,
GtkRequisition *requisition);
+static void e_calendar_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width);
+static void e_calendar_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height);
static void e_calendar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint e_calendar_drag_motion (GtkWidget *widget,
@@ -115,7 +121,8 @@ e_calendar_class_init (ECalendarClass *class)
widget_class->realize = e_calendar_realize;
widget_class->style_set = e_calendar_style_set;
- widget_class->size_request = e_calendar_size_request;
+ widget_class->get_preferred_width = e_calendar_get_preferred_width;
+ widget_class->get_preferred_height = e_calendar_get_preferred_height;
widget_class->size_allocate = e_calendar_size_allocate;
widget_class->drag_motion = e_calendar_drag_motion;
widget_class->drag_leave = e_calendar_drag_leave;
@@ -304,6 +311,30 @@ e_calendar_size_request (GtkWidget *widget,
}
static void
+e_calendar_get_preferred_width (GtkWidget *widget,
+ gint *minimal_width,
+ gint *natural_width)
+{
+ GtkRequisition requisition;
+
+ e_calendar_size_request (widget, &requisition);
+
+ *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+e_calendar_get_preferred_height (GtkWidget *widget,
+ gint *minimal_height,
+ gint *natural_height)
+{
+ GtkRequisition requisition;
+
+ e_calendar_size_request (widget, &requisition);
+
+ *minimal_height = *natural_height = requisition.height;
+}
+
+static void
e_calendar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]