From ad4dd4802655474a7c087acc8f7b9a64a2871400 Mon Sep 17 00:00:00 2001 From: Niklas080208 Date: Fri, 6 Feb 2026 22:06:01 +0100 Subject: [PATCH] Fix storage bar colours when theme uses custom background image The header storage bar (microSD/System) used ThemeEntryID_BACKGROUND and ThemeEntryID_TEXT_INFO. When a theme sets background to an image path, no colour is set for that entry, so the bar got an unset/default colour (often white) and looked wrong on dark themes. Use PROGRESSBAR and PROGRESSBAR_BACKGROUND for the bar so it always uses theme colours that are defined as colours, not images. --- .DS_Store | Bin 0 -> 8196 bytes sphaira/source/ui/menus/menu_base.cpp | 13 +++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6668f5e2f72566ba17de1e5544751fa5532dfe2b GIT binary patch literal 8196 zcmeHMYiJ!s6rOMM=x(znlQc;;P1@WVA2nKyu`#u^S={WV zckjKa?;t3O7SUhg3;d-b78MmAe*~>oMSo~SDk4%Jh#&}xzXUxqvnfr}{1dTu2WGyR zbLPzMoc+!YXO}UCj=X&}V-{mfrz((_QFE3e^r9{*S|lkV1lcoYdtsq7?FH#Yb7Mj5 zf!G7F2VxJz9*8~g-|zsP*`nx6ocl@}x3LFe51f}C5buWsRe{L}XBEm<2Q@MUAS@=a zEYznwK-wfCOh!1XP@2-3Dtka=iYUc^GADgPOeai6IIB>ZGbnS0=*oyP6v(TST|!Q0 zNGgom*aNW#7JESC?jG^w6TYB1a!(2tsX1ab6Kl1~c86!0*pGLO+rTy!@0Oj`PY)%FE=vRL`R3i$G2Vo;P8xV=O)Ko+wpVm z&90L*j7nTFbxr$0&Wz|{rI&acP^J(``-p$=QSH&wUR$GncO*UP-H?W13t@GCm zskzW4XV#(C)^#bq#9C(#g|tbXr_{vD&GqKcEv|1HJXDevv(*~*QfbFCxUJ0E z%yw&}p!{s`9wppl)>xyNU}}nPIW&}PtCh44h|BIyg}J_I#}~JBT~?m9J;t74ud-w8ef9B8$aUbr- z19%jV;|V;4r|~Ra!pnFCZ{s6;j8E_>zQjpI1jj8c`tEH&7Fr22<=P>Q)*~6(}$Ik9uJ?Bn1ohTOpw4%DE zc4b0D)y6H`P7zQscAliCQ(y9ZL6k@;$k;lAt8-S}s`>_VP2*AlI!uA$9M(l_@@3KN zri*k66kZYy*Ih=#9$u=34ePJeDJZ!nhh{_TH3o$qFN%ii+i3_jFgIUsP!RIsx%#?Q z)>d9btZ{SV5g?I5Dj^P7*NR0m+ zU*iY-jNi`Saqm2X72@}WJT44oeJ}72l60Q=3k~AYIp_g#_EWJ${=a?c@BeaA+{7M; zJ@EhZ0E)W?yEGetColour(ThemeEntryID_TEXT), "System %.1f GB"_i18n.c_str(), pdata.emmc_free / 1024.0 / 1024.0 / 1024.0); // gfx::drawTextArgs(vg, storage_x, storage_y, storage_font, NVG_ALIGN_LEFT | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT), "eMMC %.1f GB"_i18n.c_str(), pdata.emmc_free / 1024.0 / 1024.0 / 1024.0); + // Use progressbar colours (never BACKGROUND) so themes with custom background images work #if 0 Vec4 prog_bar{storage_x, storage_y + 24, STORAGE_BAR_W, STORAGE_BAR_H}; gfx::drawRect(vg, prog_bar, theme->GetColour(ThemeEntryID_PROGRESSBAR_BACKGROUND), rounding); gfx::drawRect(vg, prog_bar.x, prog_bar.y, ((double)pdata.emmc_free / (double)pdata.emmc_total) * prog_bar.w, prog_bar.h, theme->GetColour(ThemeEntryID_PROGRESSBAR), rounding); #else - gfx::drawRect(vg, storage_x, storage_y + 24, STORAGE_BAR_W, STORAGE_BAR_H, theme->GetColour(ThemeEntryID_TEXT_INFO), rounding); - gfx::drawRect(vg, storage_x + 1, storage_y + 24 + 1, STORAGE_BAR_W - 2, STORAGE_BAR_H - 2, theme->GetColour(ThemeEntryID_BACKGROUND), rounding); - gfx::drawRect(vg, storage_x + 2, storage_y + 24 + 2, STORAGE_BAR_W - (((double)pdata.emmc_free / (double)pdata.emmc_total) * STORAGE_BAR_W) - 4, STORAGE_BAR_H - 4, theme->GetColour(ThemeEntryID_TEXT_INFO), rounding); + gfx::drawRect(vg, storage_x, storage_y + 24, STORAGE_BAR_W, STORAGE_BAR_H, theme->GetColour(ThemeEntryID_PROGRESSBAR), rounding); + gfx::drawRect(vg, storage_x + 1, storage_y + 24 + 1, STORAGE_BAR_W - 2, STORAGE_BAR_H - 2, theme->GetColour(ThemeEntryID_PROGRESSBAR_BACKGROUND), rounding); + gfx::drawRect(vg, storage_x + 2, storage_y + 24 + 2, STORAGE_BAR_W - (((double)pdata.emmc_free / (double)pdata.emmc_total) * STORAGE_BAR_W) - 4, STORAGE_BAR_H - 4, theme->GetColour(ThemeEntryID_PROGRESSBAR), rounding); #endif storage_x -= (STORAGE_BAR_W + spacing); gfx::drawTextArgs(vg, storage_x, storage_y, storage_font, NVG_ALIGN_LEFT | NVG_ALIGN_TOP, theme->GetColour(ThemeEntryID_TEXT), "microSD %.1f GB"_i18n.c_str(), pdata.sd_free / 1024.0 / 1024.0 / 1024.0); - gfx::drawRect(vg, storage_x, storage_y + 24, STORAGE_BAR_W, STORAGE_BAR_H, theme->GetColour(ThemeEntryID_TEXT_INFO), rounding); - gfx::drawRect(vg, storage_x + 1, storage_y + 24 + 1, STORAGE_BAR_W - 2, STORAGE_BAR_H - 2, theme->GetColour(ThemeEntryID_BACKGROUND), rounding); - gfx::drawRect(vg, storage_x + 2, storage_y + 24 + 2, STORAGE_BAR_W - (((double)pdata.sd_free / (double)pdata.sd_total) * STORAGE_BAR_W) - 4, STORAGE_BAR_H - 4, theme->GetColour(ThemeEntryID_TEXT_INFO), rounding); + gfx::drawRect(vg, storage_x, storage_y + 24, STORAGE_BAR_W, STORAGE_BAR_H, theme->GetColour(ThemeEntryID_PROGRESSBAR), rounding); + gfx::drawRect(vg, storage_x + 1, storage_y + 24 + 1, STORAGE_BAR_W - 2, STORAGE_BAR_H - 2, theme->GetColour(ThemeEntryID_PROGRESSBAR_BACKGROUND), rounding); + gfx::drawRect(vg, storage_x + 2, storage_y + 24 + 2, STORAGE_BAR_W - (((double)pdata.sd_free / (double)pdata.sd_total) * STORAGE_BAR_W) - 4, STORAGE_BAR_H - 4, theme->GetColour(ThemeEntryID_PROGRESSBAR), rounding); start_x -= (STORAGE_BAR_W + spacing) * 2; // ran out of space, its one or the other.