aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-07-29 09:01:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-07-29 09:33:01 +0800
commit41569bb778e228d4f5a04cb1e15bfa5b49bb044b (patch)
tree3cd61379dbfcca4a9998800bbe9680b87fcb9692 /calendar/gui/e-week-view.c
parent7bebc31932e74db65e3720f32ab2f6664fd9e58b (diff)
downloadgsoc2013-evolution-41569bb778e228d4f5a04cb1e15bfa5b49bb044b.tar.gz
gsoc2013-evolution-41569bb778e228d4f5a04cb1e15bfa5b49bb044b.tar.zst
gsoc2013-evolution-41569bb778e228d4f5a04cb1e15bfa5b49bb044b.zip
Trimming redundancy.
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r--calendar/gui/e-week-view.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 4c3b940b4f..b671abb6c9 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -718,14 +718,14 @@ init_model (EWeekView *week_view, ECalModel *model)
*
* Creates a new #EWeekView.
**/
-GtkWidget *
+ECalendarView *
e_week_view_new (ECalModel *model)
{
- GtkWidget *week_view;
+ ECalendarView *week_view;
- week_view = GTK_WIDGET (g_object_new (E_TYPE_WEEK_VIEW, NULL));
- e_calendar_view_set_model ((ECalendarView *) week_view, model);
- init_model ((EWeekView *) week_view, model);
+ week_view = g_object_new (E_TYPE_WEEK_VIEW, NULL);
+ e_calendar_view_set_model (week_view, model);
+ init_model (E_WEEK_VIEW (week_view), model);
return week_view;
}
@@ -4285,10 +4285,14 @@ e_week_view_convert_time_to_display (EWeekView *week_view,
const gchar **suffix,
gint *suffix_width)
{
+ ECalModel *model;
+
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+
/* Calculate the actual hour number to display. For 12-hour
format we convert 0-23 to 12-11am/12-11pm. */
*display_hour = hour;
- if (e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (week_view))) {
+ if (e_cal_model_get_use_24_hour_format (model)) {
*suffix = "";
*suffix_width = 0;
} else {
@@ -4310,8 +4314,11 @@ e_week_view_convert_time_to_display (EWeekView *week_view,
gint
e_week_view_get_time_string_width (EWeekView *week_view)
{
+ ECalModel *model;
gint time_width;
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+
if (week_view->use_small_font && week_view->small_font_desc)
time_width = week_view->digit_width * 2
+ week_view->small_digit_width * 2;
@@ -4319,7 +4326,7 @@ e_week_view_get_time_string_width (EWeekView *week_view)
time_width = week_view->digit_width * 4
+ week_view->colon_width;
- if (!e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (week_view)))
+ if (!e_cal_model_get_use_24_hour_format (model))
time_width += MAX (week_view->am_string_width,
week_view->pm_string_width);