diff options
author | JP Rosevear <jpr@ximian.com> | 2002-07-26 03:24:52 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2002-07-26 03:24:52 +0800 |
commit | cfaa972fcb46ff0d071d367084e910ec91f4f3c4 (patch) | |
tree | 3a292a4b4802404829bada92a456c0163138f700 /calendar/gui | |
parent | 66642cda020a8edf6b32de1144d8cd1fbb960855 (diff) | |
download | gsoc2013-evolution-cfaa972fcb46ff0d071d367084e910ec91f4f3c4.tar.gz gsoc2013-evolution-cfaa972fcb46ff0d071d367084e910ec91f4f3c4.tar.zst gsoc2013-evolution-cfaa972fcb46ff0d071d367084e910ec91f4f3c4.zip |
set large_font to NULL (e_day_view_style_set): calculate large font, fall
2002-07-25 JP Rosevear <jpr@ximian.com>
* 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
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); |