fix(settings): make the rescan slider visible on light themes

The scan-height slider drew its track, % label, and thumb in pure white, which
vanished on light skins because the glass sub-section goes opaque white there
(only the numeric input showed). Switch those to OnSurface-based colors so they
adapt: near-white on dark (unchanged look) and dark on light (now visible).
Surfaced by the full Windows UI sweep on the marble/light skins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 21:04:58 -05:00
parent 8b9cd5bf80
commit 56cd9b6273

View File

@@ -2804,7 +2804,9 @@ static void RenderScanHeightControl(char* buf, size_t bufSize, int tipHeight, bo
const float pct = std::clamp((float)cur / (float)tipHeight, 0.0f, 1.0f); const float pct = std::clamp((float)cur / (float)tipHeight, 0.0f, 1.0f);
// Track + accent fill up to the thumb (fill's rounded right edge matches the thumb circle). // Track + accent fill up to the thumb (fill's rounded right edge matches the thumb circle).
dl->AddRectFilled(barMin, barMax, IM_COL32(255, 255, 255, enabled ? 26 : 12), barRound); // OnSurface-based (not pure white) so the track/label/thumb stay visible on a light-theme glass
// panel, which goes opaque white.
dl->AddRectFilled(barMin, barMax, m::WithAlpha(m::OnSurface(), enabled ? 30 : 14), barRound);
const float usableW = barW - thumbR * 2.0f; const float usableW = barW - thumbR * 2.0f;
const float thumbCenterX = barMin.x + thumbR + usableW * pct; const float thumbCenterX = barMin.x + thumbR + usableW * pct;
const float fillRight = thumbCenterX + thumbR; const float fillRight = thumbCenterX + thumbR;
@@ -2820,13 +2822,13 @@ static void RenderScanHeightControl(char* buf, size_t bufSize, int tipHeight, bo
const ImVec2 tsz = cap->CalcTextSizeA(cap->LegacySize, 10000.0f, 0.0f, pctBuf); const ImVec2 tsz = cap->CalcTextSizeA(cap->LegacySize, 10000.0f, 0.0f, pctBuf);
dl->AddText(cap, cap->LegacySize, dl->AddText(cap, cap->LegacySize,
ImVec2(barMin.x + (barW - tsz.x) * 0.5f, barMin.y + (barH - tsz.y) * 0.5f), ImVec2(barMin.x + (barW - tsz.x) * 0.5f, barMin.y + (barH - tsz.y) * 0.5f),
IM_COL32(255, 255, 255, enabled ? 190 : 80), pctBuf); m::WithAlpha(m::OnSurface(), enabled ? 200 : 80), pctBuf);
} }
// Glass thumb (drawn last so it sits above the fill + label). // Glass thumb (drawn last so it sits above the fill + label).
const float thumbY = barMin.y + barH * 0.5f; const float thumbY = barMin.y + barH * 0.5f;
dl->AddCircleFilled(ImVec2(thumbCenterX, thumbY), thumbR, IM_COL32(255, 255, 255, enabled ? 205 : 90), 24); dl->AddCircleFilled(ImVec2(thumbCenterX, thumbY), thumbR, m::WithAlpha(m::OnSurface(), enabled ? 215 : 90), 24);
dl->AddCircle(ImVec2(thumbCenterX, thumbY), thumbR, IM_COL32(255, 255, 255, enabled ? 120 : 50), 24, 1.4f * dp); dl->AddCircle(ImVec2(thumbCenterX, thumbY), thumbR, m::WithAlpha(m::OnSurface(), enabled ? 130 : 50), 24, 1.4f * dp);
if (hovered && enabled) { if (hovered && enabled) {
ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);