aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2019-05-14 07:10:33 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-05-26 10:04:28 -0400
commitd15f1e9242f77d9021af8c4b45eec96eb82a8eb6 (patch)
tree82576fecf3b52d08cc6b8d99925ce017c4e1615d /src/custom.c
parent4db9677119f412fd38440e5591afbfb631a11b3d (diff)
downloadcalcurse-d15f1e9242f77d9021af8c4b45eec96eb82a8eb6.tar.gz
calcurse-d15f1e9242f77d9021af8c4b45eec96eb82a8eb6.zip
Automate the calculation of number of days to load
Instead of having the user tell how many days to load, calcurse can calculate an overestimation from the running configuration (panel size, appearance of headers and separators etc.) The configuration variable conf.multiple_days is turned into a Boolean that switches the feature 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.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/custom.c b/src/custom.c
index 52ecdcd..d474d5b 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -643,13 +643,10 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
_("(insert an empty line after each appointment)"));
break;
case MULTIPLE_DAYS:
- custom_apply_attr(win, ATTR_HIGHEST);
- mvwprintw(win, y, XPOS + strlen(opt[MULTIPLE_DAYS]), "%d",
- conf.multiple_days);
- custom_remove_attr(win, ATTR_HIGHEST);
+ print_bool_option_incolor(win, conf.multiple_days, y,
+ XPOS + strlen(opt[MULTIPLE_DAYS]));
mvwaddstr(win, y + 1, XPOS,
- _("(number of days (1..21) to display in the appointments "
- "panel)"));
+ _("(display more than one day in the appointments panel)"));
break;
case AUTO_SAVE:
print_bool_option_incolor(win, conf.auto_save, y,
@@ -807,10 +804,7 @@ static void general_option_edit(int i)
ui_todo_load_items();
break;
case MULTIPLE_DAYS:
- if (conf.multiple_days == 21)
- conf.multiple_days = 1;
- else
- conf.multiple_days++;
+ conf.multiple_days = !conf.multiple_days;
break;
case HEADER_LINE:
conf.header_line = !conf.header_line;