diff --git a/firmware/application/ui_menu.cpp b/firmware/application/ui_menu.cpp index 4b79cbb1..4a04e817 100644 --- a/firmware/application/ui_menu.cpp +++ b/firmware/application/ui_menu.cpp @@ -69,10 +69,16 @@ MenuView::~MenuView() { } } -void MenuView::add_item(const MenuItem item) { +void MenuView::add_item(MenuItem item) { add_child(new MenuItemView { item }); } +void MenuView::add_items(std::initializer_list items) { + for(auto item : items) { + add_item(item); + } +} + void MenuView::set_parent_rect(const Rect new_parent_rect) { View::set_parent_rect(new_parent_rect); diff --git a/firmware/application/ui_menu.hpp b/firmware/application/ui_menu.hpp index 6873e5da..7d10dbf6 100644 --- a/firmware/application/ui_menu.hpp +++ b/firmware/application/ui_menu.hpp @@ -45,7 +45,7 @@ class MenuItemView : public Widget { public: MenuItemView( MenuItem item - ) : item(item) + ) : item { item } { } @@ -69,13 +69,8 @@ public: ~MenuView(); - void add_item(const MenuItem item); - - void add_items(const std::initializer_list items) { - for(const auto& item : items) { - add_item(item); - } - } + void add_item(MenuItem item); + void add_items(std::initializer_list items); void set_parent_rect(const Rect new_parent_rect) override;