Experiment with the collapsible header thingy. Slightly increase the font size of headers.

This commit is contained in:
Henrik Rydgård 2023-07-17 01:11:37 +02:00
parent 434aab9e69
commit 3861e97a94
4 changed files with 50 additions and 48 deletions

View File

@ -607,6 +607,7 @@ CollapsibleHeader::CollapsibleHeader(bool *toggle, const std::string &text, Layo
void CollapsibleHeader::Draw(UIContext &dc) { void CollapsibleHeader::Draw(UIContext &dc) {
Style style = dc.theme->itemStyle; Style style = dc.theme->itemStyle;
style.background.color = 0;
if (HasFocus()) style = dc.theme->itemFocusedStyle; if (HasFocus()) style = dc.theme->itemFocusedStyle;
if (down_) style = dc.theme->itemDownStyle; if (down_) style = dc.theme->itemDownStyle;
if (!IsEnabled()) style = dc.theme->itemDisabledStyle; if (!IsEnabled()) style = dc.theme->itemDisabledStyle;

View File

@ -382,7 +382,7 @@ static const char *const gpuUseFlagNames[32] = {
"GPU_USE_VS_RANGE_CULLING", "GPU_USE_VS_RANGE_CULLING",
"GPU_USE_BLEND_MINMAX", "GPU_USE_BLEND_MINMAX",
"GPU_USE_LOGIC_OP", "GPU_USE_LOGIC_OP",
"N/A", "GPU_USE_FRAGMENT_UBERSHADER",
"GPU_USE_TEXTURE_NPOT", "GPU_USE_TEXTURE_NPOT",
"GPU_USE_ANISOTROPY", "GPU_USE_ANISOTROPY",
"GPU_USE_CLEAR_RAM_HACK", "GPU_USE_CLEAR_RAM_HACK",

View File

@ -472,42 +472,43 @@ void SystemInfoScreen::CreateTabs() {
LinearLayout *deviceSpecs = AddTab("Device Info", si->T("Device Info")); LinearLayout *deviceSpecs = AddTab("Device Info", si->T("Device Info"));
deviceSpecs->Add(new ItemHeader(si->T("System Information"))); CollapsibleSection *systemInfo = deviceSpecs->Add(new CollapsibleSection(si->T("System Information")));
deviceSpecs->Add(new InfoItem(si->T("System Name", "Name"), System_GetProperty(SYSPROP_NAME))); systemInfo->Add(new InfoItem(si->T("System Name", "Name"), System_GetProperty(SYSPROP_NAME)));
#if PPSSPP_PLATFORM(ANDROID) #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 #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); std::string board = System_GetProperty(SYSPROP_BOARDNAME);
if (!board.empty()) if (!board.empty())
deviceSpecs->Add(new InfoItem(si->T("Board"), board)); systemInfo->Add(new InfoItem(si->T("Board"), board));
deviceSpecs->Add(new InfoItem(si->T("ABI"), GetCompilerABI())); systemInfo->Add(new InfoItem(si->T("ABI"), GetCompilerABI()));
#ifdef _WIN32 #ifdef _WIN32
if (IsDebuggerPresent()) { 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 #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. // Don't bother showing the CPU name if we don't have one.
if (strcmp(cpu_info.brand_string, "Unknown") != 0) { 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; 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); 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) #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 #endif
deviceSpecs->Add(new ItemHeader(si->T("GPU Information")));
CollapsibleSection *gpuInfo = deviceSpecs->Add(new CollapsibleSection(si->T("GPU Information")));
DrawContext *draw = screenManager()->getDrawContext(); DrawContext *draw = screenManager()->getDrawContext();
const std::string apiNameKey = draw->GetInfoString(InfoField::APINAME); const std::string apiNameKey = draw->GetInfoString(InfoField::APINAME);
const char *apiName = gr->T(apiNameKey); 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). // TODO: Not really vendor, on most APIs it's a device name (GL calls it vendor though).
std::string vendorString; std::string vendorString;
@ -516,22 +517,22 @@ void SystemInfoScreen::CreateTabs() {
} else { } else {
vendorString = draw->GetInfoString(InfoField::VENDORSTRING); 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); std::string vendor = draw->GetInfoString(InfoField::VENDOR);
if (vendor.size()) if (vendor.size())
deviceSpecs->Add(new InfoItem(si->T("Vendor (detected)"), vendor)); gpuInfo->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("Driver Version"), draw->GetInfoString(InfoField::DRIVER)));
#ifdef _WIN32 #ifdef _WIN32
if (GetGPUBackend() != GPUBackend::VULKAN) 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 !PPSSPP_PLATFORM(UWP)
if (GetGPUBackend() == GPUBackend::DIRECT3D9) { 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
#endif #endif
if (GetGPUBackend() == GPUBackend::OPENGL) { 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_min = gl_extensions.range[1][5][0];
int highp_int_max = gl_extensions.range[1][5][1]; int highp_int_max = gl_extensions.range[1][5][1];
int highp_float_min = gl_extensions.range[1][2][0]; int highp_float_min = gl_extensions.range[1][2][0];
@ -539,15 +540,15 @@ void SystemInfoScreen::CreateTabs() {
if (highp_int_max != 0) { if (highp_int_max != 0) {
char temp[512]; char temp[512];
snprintf(temp, sizeof(temp), "Highp int range: %d-%d", highp_int_min, highp_int_max); 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) { if (highp_float_max != 0) {
char temp[512]; char temp[512];
snprintf(temp, sizeof(temp), "Highp float range: %d-%d", highp_int_min, highp_int_max); 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; std::string texCompressionFormats;
// Simple non-detailed summary of supported tex compression formats. // 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::BC1_RGBA_UNORM_BLOCK)) texCompressionFormats += "BC1-3 ";
if (draw->GetDataFormatSupport(Draw::DataFormat::BC4_UNORM_BLOCK)) texCompressionFormats += "BC4-5 "; if (draw->GetDataFormatSupport(Draw::DataFormat::BC4_UNORM_BLOCK)) texCompressionFormats += "BC4-5 ";
if (draw->GetDataFormatSupport(Draw::DataFormat::BC7_UNORM_BLOCK)) texCompressionFormats += "BC7 "; 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"))); CollapsibleSection *osInformation = deviceSpecs->Add(new CollapsibleSection(si->T("OS Information")));
deviceSpecs->Add(new InfoItem(si->T("Memory Page Size"), StringFromFormat(si->T("%d bytes"), GetMemoryProtectPageSize()))); osInformation->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"))); osInformation->Add(new InfoItem(si->T("RW/RX exclusive"), PlatformIsWXExclusive() ? di->T("Active") : di->T("Inactive")));
#if PPSSPP_PLATFORM(ANDROID) #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 #endif
const char *build = si->T("Release"); const char *build = si->T("Release");
#ifdef _DEBUG #ifdef _DEBUG
build = si->T("Debug"); build = si->T("Debug");
#endif #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"))); CollapsibleSection *audioInformation = deviceSpecs->Add(new CollapsibleSection(si->T("Audio Information")));
deviceSpecs->Add(new InfoItem(si->T("Sample rate"), StringFromFormat(si->T("%d Hz"), System_GetPropertyInt(SYSPROP_AUDIO_SAMPLE_RATE)))); 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); int framesPerBuffer = System_GetPropertyInt(SYSPROP_AUDIO_FRAMES_PER_BUFFER);
if (framesPerBuffer > 0) { 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) #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)))); audioInformation->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 frames per buffer"), StringFromFormat("%d", System_GetPropertyInt(SYSPROP_AUDIO_OPTIMAL_FRAMES_PER_BUFFER))));
#endif #endif
deviceSpecs->Add(new ItemHeader(si->T("Display Information"))); CollapsibleSection *displayInfo = deviceSpecs->Add(new CollapsibleSection(si->T("Display Information")));
#if PPSSPP_PLATFORM(ANDROID) #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_XRES),
System_GetPropertyInt(SYSPROP_DISPLAY_YRES)))); 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_xres,
g_display.dp_yres, g_display.dp_yres,
si->T("DPI"), si->T("DPI"),
@ -596,10 +597,10 @@ void SystemInfoScreen::CreateTabs() {
#if !PPSSPP_PLATFORM(WINDOWS) #if !PPSSPP_PLATFORM(WINDOWS)
// Don't show on Windows, since it's always treated as 60 there. // 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 #endif
deviceSpecs->Add(new ItemHeader(si->T("Version Information"))); CollapsibleSection *versionInfo = deviceSpecs->Add(new CollapsibleSection(si->T("Version Information")));
std::string apiVersion; std::string apiVersion;
if (GetGPUBackend() == GPUBackend::OPENGL) { if (GetGPUBackend() == GPUBackend::OPENGL) {
if (gl_extensions.IsGLES) { if (gl_extensions.IsGLES) {
@ -612,26 +613,26 @@ void SystemInfoScreen::CreateTabs() {
if (apiVersion.size() > 30) if (apiVersion.size() > 30)
apiVersion.resize(30); apiVersion.resize(30);
} }
deviceSpecs->Add(new InfoItem(si->T("API Version"), apiVersion)); versionInfo->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("Shading Language"), draw->GetInfoString(InfoField::SHADELANGVERSION)));
#if PPSSPP_PLATFORM(ANDROID) #if PPSSPP_PLATFORM(ANDROID)
std::string moga = System_GetProperty(SYSPROP_MOGA_VERSION); std::string moga = System_GetProperty(SYSPROP_MOGA_VERSION);
if (moga.empty()) { if (moga.empty()) {
moga = si->T("(none detected)"); moga = si->T("(none detected)");
} }
deviceSpecs->Add(new InfoItem("Moga", moga)); versionInfo->Add(new InfoItem("Moga", moga));
#endif #endif
if (gstate_c.GetUseFlags()) { if (gstate_c.GetUseFlags()) {
// We're in-game, and can determine these. // We're in-game, and can determine these.
// TODO: Call a static version of GPUCommon::CheckGPUFeatures() and derive them here directly. // 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++) { for (int i = 0; i < 32; i++) {
if (gstate_c.Use((1 << 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);
} }
} }
} }

View File

@ -191,12 +191,12 @@ void UpdateTheme(UIContext *ctx) {
#if defined(USING_WIN_UI) || PPSSPP_PLATFORM(UWP) || defined(USING_QT_UI) #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.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.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 17);
ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 12); ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), g_Config.sFont.c_str(), 13);
#else #else
ui_theme.uiFont = UI::FontStyle(FontID("UBUNTU24"), "", 20); ui_theme.uiFont = UI::FontStyle(FontID("UBUNTU24"), "", 20);
ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), "", 14); ui_theme.uiFontSmall = UI::FontStyle(FontID("UBUNTU24"), "", 15);
ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), "", 11); ui_theme.uiFontSmaller = UI::FontStyle(FontID("UBUNTU24"), "", 12);
#endif #endif
ui_theme.checkOn = ImageID("I_CHECKEDBOX"); ui_theme.checkOn = ImageID("I_CHECKEDBOX");