Skip to content

Commit

Permalink
disabling button on main menu, change labels and add 'icons' (#2466)
Browse files Browse the repository at this point in the history
* disabling button on main menu, change labels and add 'icons'

* fix reverse order of buttons

---------

Co-authored-by: gullradriel <[email protected]>
  • Loading branch information
gullradriel and gullradriel authored Jan 4, 2025
1 parent 9788949 commit 65f3013
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions firmware/application/ui/ui_btngrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ void BtnGridView::set_arrow_up_enabled(bool enabled) {
if (enabled) {
if (!arrow_up_enabled) {
arrow_up_enabled = true;
button_pgup.set_text("PAGE UP");
button_pgup.set_text("< PREV");
}
} else if (!enabled) {
if (arrow_up_enabled) {
arrow_up_enabled = false;
button_pgup.set_text(" ");
button_pgup.set_text(" ");
}
}
};
Expand All @@ -126,12 +126,12 @@ void BtnGridView::set_arrow_down_enabled(bool enabled) {
if (enabled) {
if (!arrow_down_enabled) {
arrow_down_enabled = true;
button_pgdown.set_text("PAGE DOWN");
button_pgdown.set_text("NEXT >");
}
} else if (!enabled) {
if (arrow_down_enabled) {
arrow_down_enabled = false;
button_pgdown.set_text(" ");
button_pgdown.set_text(" ");
}
}
};
Expand Down Expand Up @@ -228,6 +228,10 @@ NewButton* BtnGridView::item_view(size_t index) const {

void BtnGridView::show_arrows_enabled(bool enabled) {
show_arrows = enabled;
if (!enabled) {
remove_child(&button_pgup);
remove_child(&button_pgdown);
}
}

bool BtnGridView::set_highlighted(int32_t new_value) {
Expand Down

0 comments on commit 65f3013

Please sign in to comment.