mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 01:57:50 +00:00
Fileman fit and finish
This commit is contained in:
@@ -163,6 +163,8 @@ void MenuView::clear() {
|
||||
}
|
||||
|
||||
menu_items.clear();
|
||||
highlighted_item = 0;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
void MenuView::add_item(MenuItem new_item) {
|
||||
@@ -209,7 +211,7 @@ MenuItemView* MenuView::item_view(size_t index) const {
|
||||
bool MenuView::set_highlighted(int32_t new_value) {
|
||||
int32_t item_count = (int32_t)menu_items.size();
|
||||
|
||||
if (new_value < 0)
|
||||
if (new_value < 0 || item_count == 0)
|
||||
return false;
|
||||
|
||||
if (new_value >= item_count)
|
||||
|
Reference in New Issue
Block a user