diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-17 09:03:49 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-17 09:08:46 +0200 |
commit | 7920e761c9827cbd9d3fb47d663d90596da3c310 (patch) | |
tree | d9412df92955b02e9e1162f7f7be6d2c4934da2a /src | |
parent | 6792a2e204d6e845a0cff61bc5dbe49b03a58d6e (diff) | |
download | calcurse-7920e761c9827cbd9d3fb47d663d90596da3c310.zip |
Reintroduce key bindings in configuration menus
The key bindings display in the status bar was removed from the general
options menu in bd182fb (Use generic list box for general options,
2014-05-13) and from the notification options menu in 5eea05a (Use
generic list box for notification options, 2014-05-13). Display the new
key bindings to use for navigation.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/custom.c | 16 | ||||
-rw-r--r-- | src/notify.c | 16 |
2 files changed, 28 insertions, 4 deletions
diff --git a/src/custom.c b/src/custom.c index 4fc3fb5..9e61705 100644 --- a/src/custom.c +++ b/src/custom.c @@ -771,6 +771,11 @@ static void general_option_edit(int i) /* General configuration. */ void custom_general_config(void) { + struct binding quit = { _("Quit"), KEY_GENERIC_QUIT }; + struct binding up = { _("Up"), KEY_MOVE_UP }; + struct binding down = { _("Down"), KEY_MOVE_DOWN }; + struct binding edit = { _("Edit Itm"), KEY_EDIT_ITEM }; + struct binding *bindings[] = { &quit, &up, &down, &edit }; struct listbox lb; int ch; @@ -780,8 +785,12 @@ void custom_general_config(void) general_option_height, print_general_option); listbox_load_items(&lb, 10); listbox_draw_deco(&lb, 0); - status_mesg("", ""); listbox_display(&lb); + wins_set_bindings(bindings, ARRAY_SIZE(bindings)); + wins_status_bar(); + wnoutrefresh(win[STA].p); + wmove(win[STA].p, 0, 0); + wins_doupdate(); while ((ch = keys_getch(win[KEY].p, NULL, NULL)) != KEY_GENERIC_QUIT) { switch (ch) { @@ -810,8 +819,11 @@ void custom_general_config(void) } } - status_mesg("", ""); listbox_display(&lb); + wins_status_bar(); + wnoutrefresh(win[STA].p); + wmove(win[STA].p, 0, 0); + wins_doupdate(); } listbox_delete(&lb); diff --git a/src/notify.c b/src/notify.c index 0b02ebd..a83de0c 100644 --- a/src/notify.c +++ b/src/notify.c @@ -775,6 +775,11 @@ static void config_option_edit(int i) /* Notify-bar configuration. */ void notify_config_bar(void) { + struct binding quit = { _("Quit"), KEY_GENERIC_QUIT }; + struct binding up = { _("Up"), KEY_MOVE_UP }; + struct binding down = { _("Down"), KEY_MOVE_DOWN }; + struct binding edit = { _("Edit Itm"), KEY_EDIT_ITEM }; + struct binding *bindings[] = { &quit, &up, &down, &edit }; struct listbox lb; int ch; @@ -784,8 +789,12 @@ void notify_config_bar(void) config_option_height, print_config_option); listbox_load_items(&lb, 8); listbox_draw_deco(&lb, 0); - status_mesg("", ""); listbox_display(&lb); + wins_set_bindings(bindings, ARRAY_SIZE(bindings)); + wins_status_bar(); + wnoutrefresh(win[STA].p); + wmove(win[STA].p, 0, 0); + wins_doupdate(); while ((ch = keys_getch(win[KEY].p, NULL, NULL)) != KEY_GENERIC_QUIT) { switch (ch) { @@ -818,8 +827,11 @@ void notify_config_bar(void) clearok(curscr, TRUE); } - status_mesg("", ""); listbox_display(&lb); + wins_status_bar(); + wnoutrefresh(win[STA].p); + wmove(win[STA].p, 0, 0); + wins_doupdate(); } listbox_delete(&lb); |