| 63 | } |
| 64 | |
| 65 | MainMenuLayout::MainMenuLayout() : pu::ui::Layout() { |
| 66 | this->info_text = pu::ui::elm::TextBlock::New(0, InfoTextY, "..."); |
| 67 | this->ResetInfoText(); |
| 68 | this->info_text->SetFont(pu::ui::GetDefaultFont(pu::ui::DefaultFontSize::MediumLarge)); |
| 69 | this->info_text->SetHorizontalAlign(pu::ui::elm::HorizontalAlign::Center); |
| 70 | this->info_text->SetColor(InfoTextColor); |
| 71 | this->Add(this->info_text); |
| 72 | |
| 73 | this->update_download_bar = pu::ui::elm::ProgressBar::New(0, UpdateDownloadBarY, UpdateDownloadBarWidth, UpdateDownloadBarHeight, 1.0f); |
| 74 | this->update_download_bar->SetHorizontalAlign(pu::ui::elm::HorizontalAlign::Center); |
| 75 | this->update_download_bar->SetVisible(false); |
| 76 | this->Add(this->update_download_bar); |
| 77 | |
| 78 | this->options_menu = pu::ui::elm::Menu::New(0, MenuY, pu::ui::render::ScreenWidth, MenuColor, MenuFocusColor, MenuItemSize, MenuItemCount); |
| 79 | |
| 80 | this->activate_menu_item = pu::ui::elm::MenuItem::New(GetStatus()); |
| 81 | this->activate_menu_item->SetColor(MenuItemColor); |
| 82 | this->activate_menu_item->AddOnKey(std::bind(&MainMenuLayout::activate_DefaultKey, this)); |
| 83 | this->options_menu->AddItem(this->activate_menu_item); |
| 84 | |
| 85 | this->reset_menu_menu_item = pu::ui::elm::MenuItem::New(GetLanguageString("reset_menu_item")); |
| 86 | this->reset_menu_menu_item->SetColor(MenuItemColor); |
| 87 | this->reset_menu_menu_item->AddOnKey(std::bind(&MainMenuLayout::resetMenu_DefaultKey, this)); |
| 88 | this->options_menu->AddItem(this->reset_menu_menu_item); |
| 89 | |
| 90 | this->reset_cache_menu_item = pu::ui::elm::MenuItem::New(GetLanguageString("reset_cache_item")); |
| 91 | this->reset_cache_menu_item->SetColor(MenuItemColor); |
| 92 | this->reset_cache_menu_item->AddOnKey(std::bind(&MainMenuLayout::resetCache_DefaultKey, this)); |
| 93 | this->options_menu->AddItem(this->reset_cache_menu_item); |
| 94 | |
| 95 | this->update_menu_item = pu::ui::elm::MenuItem::New(GetLanguageString("update_item")); |
| 96 | this->update_menu_item->SetColor(MenuItemColor); |
| 97 | this->update_menu_item->AddOnKey(std::bind(&MainMenuLayout::update_DefaultKey, this)); |
| 98 | this->options_menu->AddItem(this->update_menu_item); |
| 99 | |
| 100 | this->Add(this->options_menu); |
| 101 | |
| 102 | this->SetBackgroundColor(BackgroundColor); |
| 103 | } |
| 104 | |
| 105 | void MainMenuLayout::activate_DefaultKey() { |
| 106 | if(IsBasePresent()) { |
nothing calls this directly
no test coverage detected