diff options
author | JP Rosevear <jpr@ximian.com> | 2001-10-19 02:53:03 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-10-19 02:53:03 +0800 |
commit | 1835674efe437e678c852d806b816397eb895e12 (patch) | |
tree | bfb566460f9c9d4887719ebd6e38a83b52f919d4 /calendar | |
parent | 465fbe94651919a31bab449a1cab80776393bc68 (diff) | |
download | gsoc2013-evolution-1835674efe437e678c852d806b816397eb895e12.tar.gz gsoc2013-evolution-1835674efe437e678c852d806b816397eb895e12.tar.zst gsoc2013-evolution-1835674efe437e678c852d806b816397eb895e12.zip |
gui/e-meeting-time-sel.c
2001-10-18 JP Rosevear <jpr@ximian.com>
* gui/e-meeting-time-sel.c
* gui/e-meeting-time-sel-item.c
(e_meeting_time_selector_item_paint_day_top): use 12 or 24 hour
settings
* gui/e-meeting-time-sel.c: strings for 12 hour setting
(e_meeting_time_selector_construct): increase width slightly
* gui/e-meeting-time-sel.h: extern the new char array
svn path=/trunk/; revision=13759
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/e-meeting-time-sel-item.c | 16 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.c | 14 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.h | 4 |
3 files changed, 25 insertions, 9 deletions
diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 3cc89dc5a2..9b6db87208 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -37,6 +37,7 @@ #include <glib.h> #include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> +#include "calendar-config.h" #include "e-meeting-time-sel-item.h" #include "e-meeting-time-sel.h" @@ -491,13 +492,18 @@ e_meeting_time_selector_item_paint_day_top (EMeetingTimeSelectorItem *mts_item, gdk_gc_set_clip_rectangle (gc, NULL); /* Draw the hours. */ - hour = mts->first_hour_shown + (mts->zoomed_out ? 3 : 1); - hour_x = x + mts->col_width; + hour = mts->first_hour_shown; + hour_x = x; hour_y = mts->row_height + 4 + font->ascent - scroll_y; while (hour < mts->last_hour_shown) { - gdk_draw_string (drawable, font, gc, - hour_x - (mts->hour_widths[hour] / 2), - hour_y, EMeetingTimeSelectorHours[hour]); + if (calendar_config_get_24_hour_format ()) + gdk_draw_string (drawable, font, gc, + hour_x - (mts->hour_widths[hour] / 2), + hour_y, EMeetingTimeSelectorHours[hour]); + else + gdk_draw_string (drawable, font, gc, + hour_x - (mts->hour_widths[hour] / 2), + hour_y, EMeetingTimeSelectorHours12[hour]); hour += mts->zoomed_out ? 3 : 1; hour_x += mts->col_width; diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index f97471aa28..d90a0142c7 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -65,13 +65,21 @@ #include "calendar-config.h" #include "e-meeting-time-sel-item.h" -/* An array of hour strings, "0:00" .. "23:00". */ +/* An array of hour strings for 24 hour time, "0:00" .. "23:00". */ const gchar *EMeetingTimeSelectorHours[24] = { "0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00" }; +/* An array of hour strings for 12 hour time, "12:00am" .. "11:00pm". */ +const gchar *EMeetingTimeSelectorHours12[24] = { + "12:00am", "1:00am", "2:00am", "3:00am", "4:00am", "5:00am", "6:00am", + "7:00am", "8:00am", "9:00am", "10:00am", "11:00am", "12:00pm", + "1:00pm", "2:00pm", "3:00pm", "4:00pm", "5:00pm", "6:00pm", "7:00pm", + "8:00pm", "9:00pm", "10:00pm", "11:00pm" +}; + /* The number of days shown in the entire canvas. */ #define E_MEETING_TIME_SELECTOR_DAYS_SHOWN 365 @@ -293,8 +301,8 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingModel *em mts->meeting_positions_valid = FALSE; mts->row_height = 19; - mts->col_width = 50; - mts->day_width = 50 * 24 + 1; + mts->col_width = 55; + mts->day_width = 55 * 24 + 1; mts->auto_scroll_timeout_id = 0; diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index a0a3cd7434..a896af97c1 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -87,8 +87,10 @@ typedef enum E_MEETING_TIME_SELECTOR_REQUIRED_PEOPLE_AND_ONE_RESOURCE } EMeetingTimeSelectorAutopickOption; -/* An array of hour strings, "0:00" .. "23:00". */ +/* An array of hour strings for 24 hour time, "0:00" .. "23:00". */ extern const gchar *EMeetingTimeSelectorHours[24]; +/* An array of hour strings for 12 hour time, "12:00am" .. "11:00pm". */ +extern const gchar *EMeetingTimeSelectorHours12[24]; #define E_MEETING_TIME_SELECTOR(obj) GTK_CHECK_CAST (obj, e_meeting_time_selector_get_type (), EMeetingTimeSelector) |