mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-20 21:04:24 -04:00
Fileman fit and finish
This commit is contained in:
parent
2f343adf21
commit
c6316f5aa6
5 changed files with 93 additions and 42 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue