diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-day-view.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index b8aa114aeb..378de58323 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -629,12 +629,7 @@ e_day_view_init (EDayView *day_view) day_view->default_category = NULL; - /* Create the large font. */ - day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT); - if (!day_view->large_font) - day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT_FALLBACK); - if (!day_view->large_font) - g_warning ("Couldn't load font"); + day_view->large_font = NULL; /* String to use in 12-hour time format for times in the morning. */ day_view->am_string = _("am"); @@ -1176,6 +1171,16 @@ e_day_view_style_set (GtkWidget *widget, day_view = E_DAY_VIEW (widget); font = widget->style->font; + /* Create the large font. */ + if (day_view->large_font != NULL) + gdk_font_unref (day_view->large_font); + + day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT); + if (!day_view->large_font) + day_view->large_font = gdk_font_load (E_DAY_VIEW_LARGE_FONT_FALLBACK); + if (!day_view->large_font) + day_view->large_font = font; + /* Recalculate the height of each row based on the font size. */ day_view->row_height = font->ascent + font->descent + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD * 2 + 2 /* FIXME */; day_view->row_height = MAX (day_view->row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2); |