diff --git a/ChangeLog b/ChangeLog index 603f0bc27b..b45ff6fcb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-09-09 Matthias Clasen + + * gtk/gtkcalendar.c (gtk_calendar_init): first_weekday is relative + to week_1stday, not to Sunday. Gotta love the ISO 14652 guys... + (#314473, Stanislav Brabec) + 2005-09-09 Matthias Clasen * gtk/gtktreeview.c (gtk_tree_view_get_visible_range): Document diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 603f0bc27b..b45ff6fcb6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-09-09 Matthias Clasen + + * gtk/gtkcalendar.c (gtk_calendar_init): first_weekday is relative + to week_1stday, not to Sunday. Gotta love the ISO 14652 guys... + (#314473, Stanislav Brabec) + 2005-09-09 Matthias Clasen * gtk/gtktreeview.c (gtk_tree_view_get_visible_range): Document diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index f1ecd1d480..7cb668a816 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -565,8 +565,9 @@ gtk_calendar_init (GtkCalendar *calendar) time_t tmp_time; GtkCalendarPrivate *priv; gchar *year_before; - gchar *week_start; - + gchar *week_start, week_startsub = 1; + guint week_origin; + priv = calendar->priv = G_TYPE_INSTANCE_GET_PRIVATE (calendar, GTK_TYPE_CALENDAR, GtkCalendarPrivate); @@ -652,7 +653,15 @@ gtk_calendar_init (GtkCalendar *calendar) #ifdef HAVE__NL_TIME_FIRST_WEEKDAY week_start = nl_langinfo (_NL_TIME_FIRST_WEEKDAY); - priv->week_start = (*((unsigned char *) week_start) - 1) % 7; + week_origin = GPOINTER_TO_INT (nl_langinfo (_NL_TIME_WEEK_1STDAY)); + if (week_origin == 19971130) + week_startsub = 0; + else if (week_origin == 19971201) + week_startsub = 1; + else + g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n"); + + priv->week_start = (*((unsigned char *) week_start) - week_startsub) % 7; #else /* Translate to calendar:week_start:0 if you want Sunday to be the * first day of the week to calendar:week_start:1 if you want Monday @@ -2169,8 +2178,11 @@ calendar_paint_day (GtkCalendar *calendar, gtk_paint_focus (widget->style, priv->main_win, + state, +#if 0 (calendar->selected_day == day) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, +#endif NULL, widget, "calendar-day", day_rect.x, day_rect.y, day_rect.width, day_rect.height);