aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-05-12 21:52:43 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-05-26 10:04:27 -0400
commit4db9677119f412fd38440e5591afbfb631a11b3d (patch)
tree9fc990ddf548db4635e78a16fdc373a609390095 /src/custom.c
parentf9cf5fb0c1528c006697a23813be72f69458d53d (diff)
downloadcalcurse-4db9677119f412fd38440e5591afbfb631a11b3d.tar.gz
calcurse-4db9677119f412fd38440e5591afbfb631a11b3d.zip
Make separation of days conspicuous
... by adding a horizontal line from border to border above the day heading and turning the event separator into an empty line. The horizontal line is left out for the first day loaded. Also reduce the number of empty lines at the end of a day to at most one. A new configuration variable, header_line, turns the horizontal line on and off. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/custom.c')
-rw-r--r--src/custom.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/src/custom.c b/src/custom.c
index b5890cd..52ecdcd 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -529,7 +529,9 @@ enum {
CAL_VIEW,
TODO_VIEW,
MULTIPLE_DAYS,
- DAYSEPARATOR,
+ HEADER_LINE,
+ EVENT_SEPARATOR,
+ DAY_SEPARATOR,
EMPTY_APPT_LINE,
AUTO_SAVE,
AUTO_GC,
@@ -556,6 +558,8 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
"appearance.calendarview = ",
"appearance.todoview = ",
"general.multipledays = ",
+ "appearance.headerline = ",
+ "appearance.eventseparator = ",
"appearance.dayseparator = ",
"appearance.emptyline = ",
"general.autosave = ",
@@ -614,14 +618,23 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
custom_remove_attr(win, ATTR_HIGHEST);
mvwaddstr(win, y + 1, XPOS, _("(preferred todo display)"));
break;
- case DAYSEPARATOR:
- custom_apply_attr(win, ATTR_HIGHEST);
- mvwprintw(win, y, XPOS + strlen(opt[DAYSEPARATOR]), "%d",
- conf.dayseparator);
- custom_remove_attr(win, ATTR_HIGHEST);
- mvwaddstr(win, y + 1, XPOS,
- _("(lines between days in the appointments "
- "panel)"));
+ case HEADER_LINE:
+ print_bool_option_incolor(win, conf.header_line, y,
+ XPOS + strlen(opt[HEADER_LINE]));
+ mvwaddstr(win, y + XPOS, 1,
+ _("(horizontal line above the day heading)"));
+ break;
+ case EVENT_SEPARATOR:
+ print_bool_option_incolor(win, conf.event_separator, y,
+ XPOS + strlen(opt[EVENT_SEPARATOR]));
+ mvwaddstr(win, y + XPOS, 1,
+ _("(empty line between events and appointments)"));
+ break;
+ case DAY_SEPARATOR:
+ print_bool_option_incolor(win, conf.day_separator, y,
+ XPOS + strlen(opt[DAY_SEPARATOR]));
+ mvwaddstr(win, y + XPOS, 1,
+ _("(each day ends with an empty line)"));
break;
case EMPTY_APPT_LINE:
print_bool_option_incolor(win, conf.empty_appt_line, y,
@@ -793,20 +806,23 @@ static void general_option_edit(int i)
ui_todo_set_view(conf.todo_view);
ui_todo_load_items();
break;
- case EMPTY_APPT_LINE:
- conf.empty_appt_line = !conf.empty_appt_line;
- break;
case MULTIPLE_DAYS:
if (conf.multiple_days == 21)
conf.multiple_days = 1;
else
conf.multiple_days++;
break;
- case DAYSEPARATOR:
- if (conf.dayseparator == 2)
- conf.dayseparator = 0;
- else
- conf.dayseparator++;
+ case HEADER_LINE:
+ conf.header_line = !conf.header_line;
+ break;
+ case EVENT_SEPARATOR:
+ conf.event_separator = !conf.event_separator;
+ break;
+ case DAY_SEPARATOR:
+ conf.day_separator = !conf.day_separator;
+ break;
+ case EMPTY_APPT_LINE:
+ conf.empty_appt_line = !conf.empty_appt_line;
break;
case HEADING_POS:
if (conf.heading_pos == RIGHT)