Skip to content

Commit

Permalink
DisplayOptions: flip function bar buttons to Dec and Inc
Browse files Browse the repository at this point in the history
as per @Explorer09's suggestion in #745.

Also makes it consistent with "- Nice" and "+ Nice" in
the main function bar!
  • Loading branch information
hishamhm committed Feb 19, 2025
1 parent 08ee160 commit 4c6011c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions DisplayOptionsPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ in the source distribution for its full text.

static const char* const DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};

static const char* const DisplayOptionsIncDecFunctions[] = {"Inc ", "Dec ", " ", "Done ", NULL};
static const char* const DisplayOptionsIncDecKeys[] = {"+ ", "- ", " ", "F10", NULL};
static const int DisplayOptionsIncDecEvents[] = {'+', '-', ERR, KEY_F(10)};
static const char* const DisplayOptionsDecIncFunctions[] = {"Dec ", "Inc ", " ", "Done ", NULL};
static const char* const DisplayOptionsDecIncKeys[] = {"- ", "+ ", " ", "F10", NULL};
static const int DisplayOptionsDecIncEvents[] = {'-', '+', ERR, KEY_F(10)};

static void DisplayOptionsPanel_delete(Object* object) {
Panel* super = (Panel*) object;
DisplayOptionsPanel* this = (DisplayOptionsPanel*) object;
FunctionBar_delete(this->incDecBar);
FunctionBar_delete(this->decIncBar);
Panel_done(super);
free(this);
}
Expand Down Expand Up @@ -95,7 +95,7 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) {
/* fallthrough */
case EVENT_SET_SELECTED:
if (OptionItem_kind(selected) == OPTION_ITEM_NUMBER) {
super->currentBar = this->incDecBar;
super->currentBar = this->decIncBar;
} else {
Panel_setDefaultBar(super);
}
Expand Down Expand Up @@ -131,7 +131,7 @@ DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager*
FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, NULL, NULL);
Panel_init(super, 1, 1, 1, 1, Class(OptionItem), true, fuBar);

this->incDecBar = FunctionBar_new(DisplayOptionsIncDecFunctions, DisplayOptionsIncDecKeys, DisplayOptionsIncDecEvents);
this->decIncBar = FunctionBar_new(DisplayOptionsDecIncFunctions, DisplayOptionsDecIncKeys, DisplayOptionsDecIncEvents);
this->settings = settings;
this->scr = scr;

Expand Down
2 changes: 1 addition & 1 deletion DisplayOptionsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef struct DisplayOptionsPanel_ {

Settings* settings;
ScreenManager* scr;
FunctionBar* incDecBar;
FunctionBar* decIncBar;
} DisplayOptionsPanel;

extern const PanelClass DisplayOptionsPanel_class;
Expand Down

0 comments on commit 4c6011c

Please sign in to comment.