From e83c20a65556a4ec416b8f61ba5f42fe2a06faca Mon Sep 17 00:00:00 2001 From: Ahmed Abouzied Date: Mon, 16 Aug 2021 07:12:37 +0200 Subject: [PATCH] Add increment and decrement controls for numeric display options Signed-off-by: Ahmed Abouzied --- DisplayOptionsPanel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DisplayOptionsPanel.c b/DisplayOptionsPanel.c index 23b16bb2f7..98237d6663 100644 --- a/DisplayOptionsPanel.c +++ b/DisplayOptionsPanel.c @@ -20,7 +20,9 @@ in the source distribution for its full text. #include "ProvideCurses.h" -static const char* const DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL}; +static const char* const DisplayOptionsFunctions[] = {"(De)Select ","Increment ", "Decrement ", "Done ", NULL}; +static const char* const DisplayOptionsKeys[] = {"Enter","+", "-", "F10", "Esc"}; +static const int DisplayOptionsEvents[] = {KEY_ENTER, '+', '-', KEY_F(10), 27}; static void DisplayOptionsPanel_delete(Object* object) { Panel* super = (Panel*) object; @@ -90,7 +92,7 @@ const PanelClass DisplayOptionsPanel_class = { DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) { DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel); Panel* super = (Panel*) this; - FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, NULL, NULL); + FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, DisplayOptionsKeys, DisplayOptionsEvents); Panel_init(super, 1, 1, 1, 1, Class(OptionItem), true, fuBar); this->settings = settings;