This commit is contained in:
MihailRis
2024-03-22 11:35:55 +03:00
parent 9a817a86ff
commit b2abd57a71
4 changed files with 12 additions and 10 deletions
+2 -2
View File
@@ -269,13 +269,14 @@ void Menu::addSupplier(std::string name, supplier<std::shared_ptr<UINode>> pageS
void Menu::setPage(std::string name, bool history) {
auto found = pages.find(name);
Page page;
Page page {name, nullptr};
if (found == pages.end()) {
auto supplier = pageSuppliers.find(name);
if (supplier == pageSuppliers.end()) {
throw std::runtime_error("no page found");
} else {
page.panel = supplier->second();
// pages[name] = page;
// supplied pages caching is not implemented
}
} else {
@@ -319,4 +320,3 @@ void Menu::reset() {
current = Page{"", nullptr};
}
}