From cfaa972fcb46ff0d071d367084e910ec91f4f3c4 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 25 Jul 2002 19:24:52 +0000 Subject: set large_font to NULL (e_day_view_style_set): calculate large font, fall 2002-07-25 JP Rosevear * gui/e-day-view.c (e_day_view_init): set large_font to NULL (e_day_view_style_set): calculate large font, fall back to the style->font if necessary svn path=/trunk/; revision=17594 --- calendar/gui/e-day-view.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'calendar/gui') 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); -- cgit v1.2.3