Add a way to force recreating the UI atlas in developer tools

This commit is contained in:
Henrik Rydgård
2025-09-17 09:38:22 -06:00
parent 78274b6459
commit 21354c8671
4 changed files with 24 additions and 6 deletions
+12
View File
@@ -334,6 +334,15 @@ void DeveloperToolsScreen::CreateAudioTab(UI::LinearLayout *list) {
list->Add(new CheckBox(&g_Config.bForceFfmpegForAudioDec, dev->T("Use FFMPEG for all compressed audio")));
}
void DeveloperToolsScreen::CreateUITab(UI::LinearLayout *list) {
using namespace UI;
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
UIContext *uiContext = screenManager()->getUIContext();
list->Add(new Choice(dev->T("Reload UI atlas")))->OnClick.Add([uiContext](UI::EventParams &) {
uiContext->InvalidateAtlas();
});
}
void DeveloperToolsScreen::CreateNetworkTab(UI::LinearLayout *list) {
using namespace UI;
auto dev = GetI18NCategory(I18NCat::DEVELOPER);
@@ -477,6 +486,9 @@ void DeveloperToolsScreen::CreateTabs() {
AddTab("Tests", dev->T("Tests"), [this](UI::LinearLayout *parent) {
CreateTestsTab(parent);
});
AddTab("UI", dev->T("UI"), [this](UI::LinearLayout *parent) {
CreateUITab(parent);
});
AddTab("DumpFiles", dev->T("Dump files"), [this](UI::LinearLayout *parent) {
CreateDumpFileTab(parent);
});