aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui-calendar.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2017-12-10 00:02:08 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2017-12-10 14:33:31 +0100
commitf8e6e0d69162ee30998e433bdcd223c9537937b0 (patch)
treebf1268c997f1bc36dc5da34113a73713ad5c3bd9 /src/ui-calendar.c
parent9e060b96c2c5997342a06b9958db0bf470646a96 (diff)
downloadcalcurse-f8e6e0d69162ee30998e433bdcd223c9537937b0.tar.gz
calcurse-f8e6e0d69162ee30998e433bdcd223c9537937b0.zip
Fix no-colour theme
In colour customization, pressing cancel ('ESC' by default) will deselect all colours and put calcurse in no-color mode. For this to work, all colour changes must be performed with the routines custom_apply_attr()/custom_remove_attr(). Fixed for the getstring cursor, the scroll window border and the week number. In addition, the week number is unconditionally coloured as the rest of the calendar contents whether CAL is selected or not. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-calendar.c')
-rw-r--r--src/ui-calendar.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/ui-calendar.c b/src/ui-calendar.c
index 07d82f3..e3d90ef 100644
--- a/src/ui-calendar.c
+++ b/src/ui-calendar.c
@@ -67,7 +67,7 @@ void ui_calendar_view_next(void)
ui_calendar_view = 0;
/* The calendar panel needs to be erased when switching views. */
- monthly_view_cache_month = 0;
+ werase(sw_cal.inner);
}
void ui_calendar_view_prev(void)
@@ -77,7 +77,7 @@ void ui_calendar_view_prev(void)
ui_calendar_view--;
/* The calendar panel needs to be erased when switching views. */
- monthly_view_cache_month = 0;
+ werase(sw_cal.inner);
}
void ui_calendar_set_view(int view)
@@ -334,15 +334,10 @@ static void draw_week_number(struct scrollwin *sw, struct tm t)
int weeknum = ISO8601weeknum(&t);
WINS_CALENDAR_LOCK;
- werase(sw_cal.inner);
- custom_apply_attr(sw->inner, ATTR_HIGHEST);
- if (wins_slctd() == CAL)
- wattron(sw->win, COLOR_PAIR(COLR_CUSTOM));
+ custom_apply_attr(sw->win, ATTR_HIGHEST);
mvwprintw(sw->win, conf.compact_panels ? 0 : 2, sw->w - 9,
"(# %02d)", weeknum);
- if (wins_slctd() == CAL)
- wattroff(sw->win, COLOR_PAIR(COLR_CUSTOM));
- custom_remove_attr(sw->inner, ATTR_HIGHEST);
+ custom_remove_attr(sw->win, ATTR_HIGHEST);
WINS_CALENDAR_UNLOCK;
}