mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 19:54:39 +00:00
MenuItem: Misc const and constructor consistency adjustments.
Also moved add_items() body to .cpp file.
This commit is contained in:
parent
9a01d59822
commit
722f9b6886
@ -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<MenuItem> 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);
|
||||
|
||||
|
@ -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<MenuItem> items) {
|
||||
for(const auto& item : items) {
|
||||
add_item(item);
|
||||
}
|
||||
}
|
||||
void add_item(MenuItem item);
|
||||
void add_items(std::initializer_list<MenuItem> items);
|
||||
|
||||
void set_parent_rect(const Rect new_parent_rect) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user