Fix extra, empty menu items in DebugMenuView.

Added TODO to prevent default construction of menu items, making this a compiler error in the future.
This commit is contained in:
Jared Boone 2016-02-19 11:22:22 -08:00
parent daeb542086
commit ac6af17b94
2 changed files with 5 additions and 1 deletions

View File

@ -269,7 +269,7 @@ DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) {
/* DebugMenuView *********************************************************/
DebugMenuView::DebugMenuView(NavigationView& nav) {
add_items<8>({ {
add_items<5>({ {
{ "Memory", [&nav](){ nav.push<DebugMemoryView>(); } },
{ "Radio State", [&nav](){ nav.push<NotImplementedView>(); } },
{ "SD Card", [&nav](){ nav.push<NotImplementedView>(); } },

View File

@ -35,6 +35,10 @@ namespace ui {
struct MenuItem {
std::string text;
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 {