Day names and selected date colour now follow user's theme.
This commit is contained in:
parent
78c0495587
commit
45a4d5446a
@ -6,6 +6,10 @@
|
|||||||
OpenBSD when changing theme color from within the configuration
|
OpenBSD when changing theme color from within the configuration
|
||||||
screen
|
screen
|
||||||
|
|
||||||
|
* src/calendar.c (calendar_update_panel): day names and selected
|
||||||
|
date are now in the same colour as user's theme inside calendar
|
||||||
|
panel
|
||||||
|
|
||||||
2009-06-01 Frederic Culot <frederic@culot.org>
|
2009-06-01 Frederic Culot <frederic@culot.org>
|
||||||
|
|
||||||
* src/io.c: patch submitted by Francois Boulogne to fix gcc
|
* src/io.c: patch submitted by Francois Boulogne to fix gcc
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $calcurse: calendar.c,v 1.22 2009/01/24 20:41:52 culot Exp $ */
|
/* $calcurse: calendar.c,v 1.23 2009/06/20 16:54:44 culot Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calcurse - text-based organizer
|
* Calcurse - text-based organizer
|
||||||
@ -245,20 +245,20 @@ calendar_update_panel (WINDOW *cwin)
|
|||||||
c_day_1 = (int) ((ymd_to_scalar (yr, mo, 1 + sunday_first) - (long) 1) % 7L);
|
c_day_1 = (int) ((ymd_to_scalar (yr, mo, 1 + sunday_first) - (long) 1) % 7L);
|
||||||
|
|
||||||
/* Write the current month and year on top of the calendar */
|
/* Write the current month and year on top of the calendar */
|
||||||
custom_apply_attr (cwin, ATTR_HIGH);
|
custom_apply_attr (cwin, ATTR_HIGHEST);
|
||||||
mvwprintw (cwin, ofs_y, (CALWIDTH - (strlen (_(monthnames[mo - 1])) + 5)) / 2,
|
mvwprintw (cwin, ofs_y, (CALWIDTH - (strlen (_(monthnames[mo - 1])) + 5)) / 2,
|
||||||
"%s %d", _(monthnames[mo - 1]), slctd_day.yyyy);
|
"%s %d", _(monthnames[mo - 1]), slctd_day.yyyy);
|
||||||
custom_remove_attr (cwin, ATTR_HIGH);
|
custom_remove_attr (cwin, ATTR_HIGHEST);
|
||||||
++ofs_y;
|
++ofs_y;
|
||||||
|
|
||||||
/* print the days, with regards to the first day of the week */
|
/* print the days, with regards to the first day of the week */
|
||||||
custom_apply_attr (cwin, ATTR_HIGH);
|
custom_apply_attr (cwin, ATTR_HIGHEST);
|
||||||
for (j = 0; j < 7; j++)
|
for (j = 0; j < 7; j++)
|
||||||
{
|
{
|
||||||
mvwprintw (cwin, ofs_y, ofs_x + 4 * j, "%s",
|
mvwprintw (cwin, ofs_y, ofs_x + 4 * j, "%s",
|
||||||
_(daynames[1 + j - sunday_first]));
|
_(daynames[1 + j - sunday_first]));
|
||||||
}
|
}
|
||||||
custom_remove_attr (cwin, ATTR_HIGH);
|
custom_remove_attr (cwin, ATTR_HIGHEST);
|
||||||
|
|
||||||
day_1_sav = (c_day_1 + 1) * 3 + c_day_1 - 7;
|
day_1_sav = (c_day_1 + 1) * 3 + c_day_1 - 7;
|
||||||
|
|
||||||
@ -293,21 +293,21 @@ calendar_update_panel (WINDOW *cwin)
|
|||||||
|| (current_day.mm != slctd_day.mm)
|
|| (current_day.mm != slctd_day.mm)
|
||||||
|| (current_day.yyyy != slctd_day.yyyy)))
|
|| (current_day.yyyy != slctd_day.yyyy)))
|
||||||
{
|
{
|
||||||
/* This is the selected day, print it in red. */
|
/* This is the selected day, print it according to user's theme. */
|
||||||
custom_apply_attr (cwin, ATTR_MIDDLE);
|
custom_apply_attr (cwin, ATTR_HIGHEST);
|
||||||
mvwprintw (cwin, ofs_y + 1, ofs_x + day_1_sav + 4 * c_day + 1, "%2d",
|
mvwprintw (cwin, ofs_y + 1, ofs_x + day_1_sav + 4 * c_day + 1, "%2d",
|
||||||
c_day);
|
c_day);
|
||||||
custom_remove_attr (cwin, ATTR_MIDDLE);
|
custom_remove_attr (cwin, ATTR_HIGHEST);
|
||||||
}
|
}
|
||||||
else if (c_day == slctd_day.dd && current_day.dd == slctd_day.dd
|
else if (c_day == slctd_day.dd && current_day.dd == slctd_day.dd
|
||||||
&& current_day.mm == slctd_day.mm
|
&& current_day.mm == slctd_day.mm
|
||||||
&& current_day.yyyy == slctd_day.yyyy)
|
&& current_day.yyyy == slctd_day.yyyy)
|
||||||
{
|
{
|
||||||
/* today is the selected day */
|
/* today is the selected day */
|
||||||
custom_apply_attr (cwin, ATTR_MIDDLE);
|
custom_apply_attr (cwin, ATTR_HIGHEST);
|
||||||
mvwprintw (cwin, ofs_y + 1, ofs_x + day_1_sav + 4 * c_day + 1, "%2d",
|
mvwprintw (cwin, ofs_y + 1, ofs_x + day_1_sav + 4 * c_day + 1, "%2d",
|
||||||
c_day);
|
c_day);
|
||||||
custom_remove_attr (cwin, ATTR_MIDDLE);
|
custom_remove_attr (cwin, ATTR_HIGHEST);
|
||||||
}
|
}
|
||||||
else if (item_this_day)
|
else if (item_this_day)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user