From: Art Cancro Date: Wed, 18 Feb 2009 18:41:46 +0000 (+0000) Subject: * Font sizes for the hour markers in the calendar day view are now set to the height... X-Git-Tag: v7.86~1441 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=d8b779a9ff974444efe99a5d41b8d2663e8a5919 * Font sizes for the hour markers in the calendar day view are now set to the height of the containing row minus 2px. * Also changed the height of the rows for 'off hours' from 1/3 of the day hours to 1/2 of the day hours. Things were just too squashed. --- diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index a36bd8539..9a9cd74cd 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -7,6 +7,9 @@ #include "webcit.h" #include "webserver.h" +/* These define how high the hour rows are in the day view */ +#define TIMELINE 30 +#define EXTRATIMELINE (TIMELINE / 2) void embeddable_mini_calendar(int year, int month) { @@ -936,15 +939,15 @@ void calendar_day_view_display_events(time_t thetime, /* Calculate the location of the top of the box */ if (event_te.tm_hour < dstart) { startmin = diffmin = event_te.tm_min / 6; - top = (event_te.tm_hour * 10) + startmin; + top = (event_te.tm_hour * EXTRATIMELINE) + startmin; } else if ((event_te.tm_hour >= dstart) && (event_te.tm_hour <= dend)) { startmin = diffmin = (event_te.tm_min / 2); - top = (dstart * 10) + ((event_te.tm_hour - dstart) * 30) + startmin; + top = (dstart * EXTRATIMELINE) + ((event_te.tm_hour - dstart) * TIMELINE) + startmin; } else if (event_te.tm_hour >dend) { startmin = diffmin = event_te.tm_min / 6; - top = (dstart * 10) + ((dend - dstart - 1) * 30) + ((event_tm.tm_hour - dend + 1) * 10) + startmin ; + top = (dstart * EXTRATIMELINE) + ((dend - dstart - 1) * TIMELINE) + ((event_tm.tm_hour - dend + 1) * EXTRATIMELINE) + startmin ; } else { /* should never get here */ @@ -953,15 +956,15 @@ void calendar_day_view_display_events(time_t thetime, /* Calculate the location of the bottom of the box */ if (event_tm.tm_hour < dstart) { endmin = diffmin = event_tm.tm_min / 6; - bottom = (event_tm.tm_hour * 10) + endmin; + bottom = (event_tm.tm_hour * EXTRATIMELINE) + endmin; } else if ((event_tm.tm_hour >= dstart) && (event_tm.tm_hour <= dend)) { endmin = diffmin = (event_tm.tm_min / 2); - bottom = (dstart * 10) + ((event_tm.tm_hour - dstart) * 30) + endmin ; + bottom = (dstart * EXTRATIMELINE) + ((event_tm.tm_hour - dstart) * TIMELINE) + endmin ; } else if (event_tm.tm_hour >dend) { endmin = diffmin = event_tm.tm_min / 6; - bottom = (dstart * 10) + ((dend - dstart + 1) * 30) + ((event_tm.tm_hour - dend - 1) * 10) + endmin; + bottom = (dstart * EXTRATIMELINE) + ((dend - dstart + 1) * TIMELINE) + ((event_tm.tm_hour - dend - 1) * EXTRATIMELINE) + endmin; } else { /* should never get here */ @@ -1021,8 +1024,8 @@ void calendar_day_view(int year, int month, int day) { char d_str[128]; int time_format; time_t today_t; - int timeline = 30; - int extratimeline = 0; + int timeline = TIMELINE; + int extratimeline = EXTRATIMELINE; int gap = 0; time_format = get_time_format_cached (); @@ -1069,18 +1072,19 @@ void calendar_day_view(int year, int month, int day) { /* Now the middle of the day... */ - extratimeline = timeline / 3; - for (hour = 0; hour < daystart; ++hour) { /* could do HEIGHT=xx */ wprintf("
" "", - (hour * extratimeline ), extratimeline, + (hour * extratimeline ), + extratimeline, + extratimeline - 2, year, month, day, hour ); @@ -1103,12 +1107,15 @@ void calendar_day_view(int year, int month, int day) { wprintf("
" "", - gap + ((hour - daystart) * timeline ), timeline, + gap + ((hour - daystart) * timeline ), + timeline, + timeline - 2, year, month, day, hour ); diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 3312d05f1..e3c2fe4f0 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -1345,11 +1345,11 @@ td.events_of_the_day { } .events_of_the_day dl dt.hour { - font-size: 160%; + /* font-size: 160%; commenting out because we need to line it up with the actual size */ } .events_of_the_day dl dt.extrahour { - font-size: 80%; + /* font-size: 80%; commenting out because we need to line it up with the actual size */ } .hour_label, .extra_events dl dt {