mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 00:29:33 +00:00
Merge remote-tracking branch 'upstream/master'
Conflicts: firmware/application/Makefile firmware/application/core_control.cpp firmware/application/touch.cpp firmware/application/ui_debug.cpp firmware/application/ui_debug.hpp firmware/application/ui_navigation.cpp firmware/baseband/baseband_thread.cpp
This commit is contained in:
@@ -36,6 +36,10 @@ struct MenuItem {
|
||||
std::string text;
|
||||
ui::Color color;
|
||||
std::function<void(void)> on_select;
|
||||
|
||||
// TODO: Prevent default-constructed MenuItems.
|
||||
// I managed to construct a menu with three extra, unspecified menu items
|
||||
// in the array that were default constructed...
|
||||
};
|
||||
|
||||
class MenuItemView : public Widget {
|
||||
@@ -54,8 +58,6 @@ public:
|
||||
|
||||
private:
|
||||
const MenuItem item;
|
||||
|
||||
void set_highlight(const bool value);
|
||||
};
|
||||
|
||||
class MenuView : public View {
|
||||
@@ -63,7 +65,7 @@ public:
|
||||
std::function<void(void)> on_left;
|
||||
|
||||
MenuView() {
|
||||
flags.focusable = true;
|
||||
set_focusable(true);
|
||||
}
|
||||
|
||||
~MenuView();
|
||||
@@ -71,7 +73,7 @@ public:
|
||||
void add_item(const MenuItem item);
|
||||
|
||||
template<size_t N>
|
||||
void add_items(const std::array<MenuItem, N> items) {
|
||||
void add_items(const std::array<MenuItem, N>& items) {
|
||||
for(const auto& item : items) {
|
||||
add_item(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user