From 3861e97a94e7bd7fda9a2fe0ff24e834eca519d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 17 Jul 2023 01:11:37 +0200 Subject: [PATCH] Experiment with the collapsible header thingy. Slightly increase the font size of headers. --- Common/UI/View.cpp | 1 + GPU/GPUState.cpp | 2 +- UI/DevScreens.cpp | 87 +++++++++++++++++++++++----------------------- UI/Theme.cpp | 8 ++--- 4 files changed, 50 insertions(+), 48 deletions(-) diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index 82c2497a7a..587db038ab 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -607,6 +607,7 @@ CollapsibleHeader::CollapsibleHeader(bool *toggle, const std::string &text, Layo void CollapsibleHeader::Draw(UIContext &dc) { Style style = dc.theme->itemStyle; + style.background.color = 0; if (HasFocus()) style = dc.theme->itemFocusedStyle; if (down_) style = dc.theme->itemDownStyle; if (!IsEnabled()) style = dc.theme->itemDisabledStyle; diff --git a/GPU/GPUState.cpp b/GPU/GPUState.cpp index c5f9882202..94bc154c6c 100644 --- a/GPU/GPUState.cpp +++ b/GPU/GPUState.cpp @@ -382,7 +382,7 @@ static const char *const gpuUseFlagNames[32] = { "GPU_USE_VS_RANGE_CULLING", "GPU_USE_BLEND_MINMAX", "GPU_USE_LOGIC_OP", - "N/A", + "GPU_USE_FRAGMENT_UBERSHADER", "GPU_USE_TEXTURE_NPOT", "GPU_USE_ANISOTROPY", "GPU_USE_CLEAR_RAM_HACK", diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 18f887de38..a9d1bce918 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -472,42 +472,43 @@ void SystemInfoScreen::CreateTabs() { LinearLayout *deviceSpecs = AddTab("Device Info", si->T("Device Info")); - deviceSpecs->Add(new ItemHeader(si->T("System Information"))); - deviceSpecs->Add(new InfoItem(si->T("System Name", "Name"), System_GetProperty(SYSPROP_NAME))); + CollapsibleSection *systemInfo = deviceSpecs->Add(new CollapsibleSection(si->T("System Information"))); + systemInfo->Add(new InfoItem(si->T("System Name", "Name"), System_GetProperty(SYSPROP_NAME))); #if PPSSPP_PLATFORM(ANDROID) - deviceSpecs->Add(new InfoItem(si->T("System Version"), StringFromInt(System_GetPropertyInt(SYSPROP_SYSTEMVERSION)))); + systemInfo->Add(new InfoItem(si->T("System Version"), StringFromInt(System_GetPropertyInt(SYSPROP_SYSTEMVERSION)))); #endif - deviceSpecs->Add(new InfoItem(si->T("Lang/Region"), System_GetProperty(SYSPROP_LANGREGION))); + systemInfo->Add(new InfoItem(si->T("Lang/Region"), System_GetProperty(SYSPROP_LANGREGION))); std::string board = System_GetProperty(SYSPROP_BOARDNAME); if (!board.empty()) - deviceSpecs->Add(new InfoItem(si->T("Board"), board)); - deviceSpecs->Add(new InfoItem(si->T("ABI"), GetCompilerABI())); + systemInfo->Add(new InfoItem(si->T("Board"), board)); + systemInfo->Add(new InfoItem(si->T("ABI"), GetCompilerABI())); #ifdef _WIN32 if (IsDebuggerPresent()) { - deviceSpecs->Add(new InfoItem(si->T("Debugger Present"), di->T("Yes"))); + systemInfo->Add(new InfoItem(si->T("Debugger Present"), di->T("Yes"))); } #endif - deviceSpecs->Add(new ItemHeader(si->T("CPU Information"))); + CollapsibleSection *cpuInfo = deviceSpecs->Add(new CollapsibleSection(si->T("CPU Information"))); // Don't bother showing the CPU name if we don't have one. if (strcmp(cpu_info.brand_string, "Unknown") != 0) { - deviceSpecs->Add(new InfoItem(si->T("CPU Name", "Name"), cpu_info.brand_string)); + cpuInfo->Add(new InfoItem(si->T("CPU Name", "Name"), cpu_info.brand_string)); } int totalThreads = cpu_info.num_cores * cpu_info.logical_cpu_count; std::string cores = StringFromFormat(si->T("%d (%d per core, %d cores)"), totalThreads, cpu_info.logical_cpu_count, cpu_info.num_cores); - deviceSpecs->Add(new InfoItem(si->T("Threads"), cores)); + cpuInfo->Add(new InfoItem(si->T("Threads"), cores)); #if PPSSPP_PLATFORM(IOS) - deviceSpecs->Add(new InfoItem(si->T("JIT available"), System_GetPropertyBool(SYSPROP_CAN_JIT) ? di->T("Yes") : di->T("No"))); + cpuInfo->Add(new InfoItem(si->T("JIT available"), System_GetPropertyBool(SYSPROP_CAN_JIT) ? di->T("Yes") : di->T("No"))); #endif - deviceSpecs->Add(new ItemHeader(si->T("GPU Information"))); + + CollapsibleSection *gpuInfo = deviceSpecs->Add(new CollapsibleSection(si->T("GPU Information"))); DrawContext *draw = screenManager()->getDrawContext(); const std::string apiNameKey = draw->GetInfoString(InfoField::APINAME); const char *apiName = gr->T(apiNameKey); - deviceSpecs->Add(new InfoItem(si->T("3D API"), apiName)); + gpuInfo->Add(new InfoItem(si->T("3D API"), apiName)); // TODO: Not really vendor, on most APIs it's a device name (GL calls it vendor though). std::string vendorString; @@ -516,22 +517,22 @@ void SystemInfoScreen::CreateTabs() { } else { vendorString = draw->GetInfoString(InfoField::VENDORSTRING); } - deviceSpecs->Add(new InfoItem(si->T("Vendor"), vendorString)); + gpuInfo->Add(new InfoItem(si->T("Vendor"), vendorString)); std::string vendor = draw->GetInfoString(InfoField::VENDOR); if (vendor.size()) - deviceSpecs->Add(new InfoItem(si->T("Vendor (detected)"), vendor)); - deviceSpecs->Add(new InfoItem(si->T("Driver Version"), draw->GetInfoString(InfoField::DRIVER))); + gpuInfo->Add(new InfoItem(si->T("Vendor (detected)"), vendor)); + gpuInfo->Add(new InfoItem(si->T("Driver Version"), draw->GetInfoString(InfoField::DRIVER))); #ifdef _WIN32 if (GetGPUBackend() != GPUBackend::VULKAN) - deviceSpecs->Add(new InfoItem(si->T("Driver Version"), System_GetProperty(SYSPROP_GPUDRIVER_VERSION))); + gpuInfo->Add(new InfoItem(si->T("Driver Version"), System_GetProperty(SYSPROP_GPUDRIVER_VERSION))); #if !PPSSPP_PLATFORM(UWP) if (GetGPUBackend() == GPUBackend::DIRECT3D9) { - deviceSpecs->Add(new InfoItem(si->T("D3DCompiler Version"), StringFromFormat("%d", GetD3DCompilerVersion()))); + gpuInfo->Add(new InfoItem(si->T("D3DCompiler Version"), StringFromFormat("%d", GetD3DCompilerVersion()))); } #endif #endif if (GetGPUBackend() == GPUBackend::OPENGL) { - deviceSpecs->Add(new InfoItem(si->T("Core Context"), gl_extensions.IsCoreContext ? di->T("Active") : di->T("Inactive"))); + gpuInfo->Add(new InfoItem(si->T("Core Context"), gl_extensions.IsCoreContext ? di->T("Active") : di->T("Inactive"))); int highp_int_min = gl_extensions.range[1][5][0]; int highp_int_max = gl_extensions.range[1][5][1]; int highp_float_min = gl_extensions.range[1][2][0]; @@ -539,15 +540,15 @@ void SystemInfoScreen::CreateTabs() { if (highp_int_max != 0) { char temp[512]; snprintf(temp, sizeof(temp), "Highp int range: %d-%d", highp_int_min, highp_int_max); - deviceSpecs->Add(new InfoItem(si->T("High precision int range"), temp)); + gpuInfo->Add(new InfoItem(si->T("High precision int range"), temp)); } if (highp_float_max != 0) { char temp[512]; snprintf(temp, sizeof(temp), "Highp float range: %d-%d", highp_int_min, highp_int_max); - deviceSpecs->Add(new InfoItem(si->T("High precision float range"), temp)); + gpuInfo->Add(new InfoItem(si->T("High precision float range"), temp)); } } - deviceSpecs->Add(new InfoItem(si->T("Depth buffer format"), DataFormatToString(draw->GetDeviceCaps().preferredDepthBufferFormat))); + gpuInfo->Add(new InfoItem(si->T("Depth buffer format"), DataFormatToString(draw->GetDeviceCaps().preferredDepthBufferFormat))); std::string texCompressionFormats; // Simple non-detailed summary of supported tex compression formats. @@ -556,38 +557,38 @@ void SystemInfoScreen::CreateTabs() { if (draw->GetDataFormatSupport(Draw::DataFormat::BC1_RGBA_UNORM_BLOCK)) texCompressionFormats += "BC1-3 "; if (draw->GetDataFormatSupport(Draw::DataFormat::BC4_UNORM_BLOCK)) texCompressionFormats += "BC4-5 "; if (draw->GetDataFormatSupport(Draw::DataFormat::BC7_UNORM_BLOCK)) texCompressionFormats += "BC7 "; - deviceSpecs->Add(new InfoItem(si->T("Compressed texture formats"), texCompressionFormats)); + gpuInfo->Add(new InfoItem(si->T("Compressed texture formats"), texCompressionFormats)); - deviceSpecs->Add(new ItemHeader(si->T("OS Information"))); - deviceSpecs->Add(new InfoItem(si->T("Memory Page Size"), StringFromFormat(si->T("%d bytes"), GetMemoryProtectPageSize()))); - deviceSpecs->Add(new InfoItem(si->T("RW/RX exclusive"), PlatformIsWXExclusive() ? di->T("Active") : di->T("Inactive"))); + CollapsibleSection *osInformation = deviceSpecs->Add(new CollapsibleSection(si->T("OS Information"))); + osInformation->Add(new InfoItem(si->T("Memory Page Size"), StringFromFormat(si->T("%d bytes"), GetMemoryProtectPageSize()))); + osInformation->Add(new InfoItem(si->T("RW/RX exclusive"), PlatformIsWXExclusive() ? di->T("Active") : di->T("Inactive"))); #if PPSSPP_PLATFORM(ANDROID) - deviceSpecs->Add(new InfoItem(si->T("Sustained perf mode"), System_GetPropertyBool(SYSPROP_SUPPORTS_SUSTAINED_PERF_MODE) ? di->T("Supported") : di->T("Unsupported"))); + osInformation->Add(new InfoItem(si->T("Sustained perf mode"), System_GetPropertyBool(SYSPROP_SUPPORTS_SUSTAINED_PERF_MODE) ? di->T("Supported") : di->T("Unsupported"))); #endif const char *build = si->T("Release"); #ifdef _DEBUG build = si->T("Debug"); #endif - deviceSpecs->Add(new InfoItem(si->T("PPSSPP build"), build)); + osInformation->Add(new InfoItem(si->T("PPSSPP build"), build)); - deviceSpecs->Add(new ItemHeader(si->T("Audio Information"))); - deviceSpecs->Add(new InfoItem(si->T("Sample rate"), StringFromFormat(si->T("%d Hz"), System_GetPropertyInt(SYSPROP_AUDIO_SAMPLE_RATE)))); + CollapsibleSection *audioInformation = deviceSpecs->Add(new CollapsibleSection(si->T("Audio Information"))); + audioInformation->Add(new InfoItem(si->T("Sample rate"), StringFromFormat(si->T("%d Hz"), System_GetPropertyInt(SYSPROP_AUDIO_SAMPLE_RATE)))); int framesPerBuffer = System_GetPropertyInt(SYSPROP_AUDIO_FRAMES_PER_BUFFER); if (framesPerBuffer > 0) { - deviceSpecs->Add(new InfoItem(si->T("Frames per buffer"), StringFromFormat("%d", framesPerBuffer))); + audioInformation->Add(new InfoItem(si->T("Frames per buffer"), StringFromFormat("%d", framesPerBuffer))); } #if PPSSPP_PLATFORM(ANDROID) - deviceSpecs->Add(new InfoItem(si->T("Optimal sample rate"), StringFromFormat(si->T("%d Hz"), System_GetPropertyInt(SYSPROP_AUDIO_OPTIMAL_SAMPLE_RATE)))); - deviceSpecs->Add(new InfoItem(si->T("Optimal frames per buffer"), StringFromFormat("%d", System_GetPropertyInt(SYSPROP_AUDIO_OPTIMAL_FRAMES_PER_BUFFER)))); + audioInformation->Add(new InfoItem(si->T("Optimal sample rate"), StringFromFormat(si->T("%d Hz"), System_GetPropertyInt(SYSPROP_AUDIO_OPTIMAL_SAMPLE_RATE)))); + audioInformation->Add(new InfoItem(si->T("Optimal frames per buffer"), StringFromFormat("%d", System_GetPropertyInt(SYSPROP_AUDIO_OPTIMAL_FRAMES_PER_BUFFER)))); #endif - deviceSpecs->Add(new ItemHeader(si->T("Display Information"))); + CollapsibleSection *displayInfo = deviceSpecs->Add(new CollapsibleSection(si->T("Display Information"))); #if PPSSPP_PLATFORM(ANDROID) - deviceSpecs->Add(new InfoItem(si->T("Native Resolution"), StringFromFormat("%dx%d", + displayInfo->Add(new InfoItem(si->T("Native Resolution"), StringFromFormat("%dx%d", System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)))); - deviceSpecs->Add(new InfoItem(si->T("UI Resolution"), StringFromFormat("%dx%d (%s: %0.2f)", + displayInfo->Add(new InfoItem(si->T("UI Resolution"), StringFromFormat("%dx%d (%s: %0.2f)", g_display.dp_xres, g_display.dp_yres, si->T("DPI"), @@ -596,10 +597,10 @@ void SystemInfoScreen::CreateTabs() { #if !PPSSPP_PLATFORM(WINDOWS) // Don't show on Windows, since it's always treated as 60 there. - deviceSpecs->Add(new InfoItem(si->T("Refresh rate"), StringFromFormat(si->T("%0.2f Hz"), (float)System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE)))); + displayInfo->Add(new InfoItem(si->T("Refresh rate"), StringFromFormat(si->T("%0.2f Hz"), (float)System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE)))); #endif - deviceSpecs->Add(new ItemHeader(si->T("Version Information"))); + CollapsibleSection *versionInfo = deviceSpecs->Add(new CollapsibleSection(si->T("Version Information"))); std::string apiVersion; if (GetGPUBackend() == GPUBackend::OPENGL) { if (gl_extensions.IsGLES) { @@ -612,26 +613,26 @@ void SystemInfoScreen::CreateTabs() { if (apiVersion.size() > 30) apiVersion.resize(30); } - deviceSpecs->Add(new InfoItem(si->T("API Version"), apiVersion)); - deviceSpecs->Add(new InfoItem(si->T("Shading Language"), draw->GetInfoString(InfoField::SHADELANGVERSION))); + versionInfo->Add(new InfoItem(si->T("API Version"), apiVersion)); + versionInfo->Add(new InfoItem(si->T("Shading Language"), draw->GetInfoString(InfoField::SHADELANGVERSION))); #if PPSSPP_PLATFORM(ANDROID) std::string moga = System_GetProperty(SYSPROP_MOGA_VERSION); if (moga.empty()) { moga = si->T("(none detected)"); } - deviceSpecs->Add(new InfoItem("Moga", moga)); + versionInfo->Add(new InfoItem("Moga", moga)); #endif if (gstate_c.GetUseFlags()) { // We're in-game, and can determine these. // TODO: Call a static version of GPUCommon::CheckGPUFeatures() and derive them here directly. - deviceSpecs->Add(new ItemHeader(si->T("GPU Flags"))); + CollapsibleSection *gpuFlags = deviceSpecs->Add(new CollapsibleSection(si->T("GPU Flags"))); for (int i = 0; i < 32; i++) { if (gstate_c.Use((1 << i))) { - deviceSpecs->Add(new TextView(GpuUseFlagToString(i), new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + gpuFlags->Add(new TextView(GpuUseFlagToString(i), new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); } } } diff --git a/UI/Theme.cpp b/UI/Theme.cpp index 9119259e7c..3e4b6193a2 100644 --- a/UI/Theme.cpp +++ b/UI/Theme.cpp @@ -191,12 +191,12 @@ void UpdateTheme(UIContext *ctx) { #if defined(USING_WIN_UI) || PPSSPP_PLATFORM(UWP) || defined(USING_QT_UI) ui_theme.uiFont = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 22); - ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 15); - ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 12); + ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 17); + ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 13); #else ui_theme.uiFont = UI::FontStyle(FontID("UBUNTU24"), "", 20); - ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), "", 14); - ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), "", 11); + ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), "", 15); + ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), "", 12); #endif ui_theme.checkOn = ImageID("I_CHECKEDBOX");