mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps] AlternateEmptyNestedMenuController handles empty lists
This commit is contained in:
18
apps/alternate_empty_nested_menu_controller.cpp
Normal file
18
apps/alternate_empty_nested_menu_controller.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "alternate_empty_nested_menu_controller.h"
|
||||
|
||||
void AlternateEmptyNestedMenuController::viewDidDisappear() {
|
||||
if (isDisplayingEmptyController()) {
|
||||
pop();
|
||||
}
|
||||
NestedMenuController::viewDidDisappear();
|
||||
}
|
||||
|
||||
bool AlternateEmptyNestedMenuController::displayEmptyController() {
|
||||
assert(!isDisplayingEmptyController());
|
||||
// If the content is empty, we push an empty controller.
|
||||
if (numberOfRows() == 0) {
|
||||
push(emptyViewController());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user