mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 11:17:58 +00:00
Contributors scroll (#2093)
* adding on_right * menu view instead of console * fixing on_right typo --------- Co-authored-by: gullradriel <gullradriel@no-mail.com>
This commit is contained in:
@@ -251,8 +251,12 @@ bool MenuView::on_key(const KeyEvent key) {
|
||||
case KeyEvent::Down:
|
||||
return set_highlighted(highlighted_item + 1);
|
||||
|
||||
case KeyEvent::Select:
|
||||
case KeyEvent::Right:
|
||||
if (on_right) {
|
||||
on_right();
|
||||
}
|
||||
[[fallthrough]];
|
||||
case KeyEvent::Select:
|
||||
if (menu_items[highlighted_item].on_select) {
|
||||
menu_items[highlighted_item].on_select(key);
|
||||
}
|
||||
|
@@ -75,6 +75,7 @@ class MenuItemView : public Widget {
|
||||
class MenuView : public View {
|
||||
public:
|
||||
std::function<void(void)> on_left{};
|
||||
std::function<void(void)> on_right{};
|
||||
std::function<void(void)> on_highlight{nullptr};
|
||||
|
||||
MenuView(Rect new_parent_rect = {0, 0, screen_width, screen_height - 16},
|
||||
|
Reference in New Issue
Block a user