diff options
author | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-12-10 20:15:27 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-25 23:37:16 +0800 |
commit | b7c2f49973b93c2e80bed6f10c534af17b757c04 (patch) | |
tree | 938da8b0b636884610fa745542cb85f100fc8331 /widgets/misc/e-calendar.c | |
parent | a2f59fe0fc9e1b8737759ecb884bca18fa8defe3 (diff) | |
download | gsoc2013-evolution-b7c2f49973b93c2e80bed6f10c534af17b757c04.tar.gz gsoc2013-evolution-b7c2f49973b93c2e80bed6f10c534af17b757c04.tar.zst gsoc2013-evolution-b7c2f49973b93c2e80bed6f10c534af17b757c04.zip |
Adapt size_request vfuncs to latest gtk+-3.0 API.
Diffstat (limited to 'widgets/misc/e-calendar.c')
-rw-r--r-- | widgets/misc/e-calendar.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index d835ba89ae..c21a6a4547 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -69,8 +69,12 @@ static void e_calendar_dispose (GObject *object); static void e_calendar_realize (GtkWidget *widget); 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 +119,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; @@ -281,26 +286,37 @@ e_calendar_style_set (GtkWidget *widget, } static void -e_calendar_size_request (GtkWidget *widget, - GtkRequisition *requisition) +e_calendar_get_preferred_width (GtkWidget *widget, + gint *minimum, + gint *natural) { ECalendar *cal; GtkStyle *style; - gint col_width, row_height, width, height; + gint col_width; cal = E_CALENDAR (widget); style = gtk_widget_get_style (GTK_WIDGET (cal)); - g_object_get ((cal->calitem), - "row_height", &row_height, - "column_width", &col_width, - NULL); + g_object_get ((cal->calitem), "column_width", &col_width, NULL); - height = row_height * cal->min_rows; - width = col_width * cal->min_cols; + *minimum = *natural = col_width * cal->min_cols + style->xthickness * 2; +} + +static void +e_calendar_get_preferred_height (GtkWidget *widget, + gint *minimum, + gint *natural) +{ + ECalendar *cal; + GtkStyle *style; + gint row_height; + + cal = E_CALENDAR (widget); + style = gtk_widget_get_style (GTK_WIDGET (cal)); + + g_object_get ((cal->calitem), "row_height", &row_height, NULL); - requisition->width = width + style->xthickness * 2; - requisition->height = height + style->ythickness * 2; + *minimum = *natural = row_height * cal->min_rows + style->ythickness * 2; } static void |