aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/gui/e-day-view.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 20c663eef4..8509c23d5c 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+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
+
2002-07-24 JP Rosevear <jpr@ximian.com>
* gui/e-itip-control.c (write_html): display the location in the
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);