diff --git a/src/ui/material/draw_helpers.h b/src/ui/material/draw_helpers.h index d323d1e..dfabaaa 100644 --- a/src/ui/material/draw_helpers.h +++ b/src/ui/material/draw_helpers.h @@ -35,6 +35,15 @@ inline ImU32 ScaleAlpha(ImU32 col, float scale) { return (col & ~IM_COL32_A_MASK) | (static_cast(a) << IM_COL32_A_SHIFT); } +// True when the active theme is light (app background luminance is high). +inline bool IsLightTheme() { + ImU32 bg = Background(); + float r = ((bg >> IM_COL32_R_SHIFT) & 0xFF) / 255.0f; + float g = ((bg >> IM_COL32_G_SHIFT) & 0xFF) / 255.0f; + float b = ((bg >> IM_COL32_B_SHIFT) & 0xFF) / 255.0f; + return (0.299f * r + 0.587f * g + 0.114f * b) > 0.5f; +} + // Animated "loading" ellipsis: "", ".", "..", "..." cycling on a ~3Hz phase. inline const char* LoadingDots() { int n = ((int)(ImGui::GetTime() * 3.0f)) % 4; @@ -227,6 +236,14 @@ inline void DrawButtonGlassOverlay(ImDrawList* dl, const ImVec2& bMin, const ImVec2& bMax, float rounding, bool active, bool hovered) { + // Light themes: flat buttons (like the Manage-portfolio modal's plain buttons). Skip the glass + // sheen + tactile 3D — ImGui::Button already draws the fill/hover/active — and add just a subtle + // defining edge, which reads cleaner on light surfaces than the raised glass look. + if (IsLightTheme()) { + ImU32 rim = schema::UI().resolveColor("var(--rim-light)", IM_COL32(0, 0, 0, 50)); + dl->AddRect(bMin, bMax, active ? ScaleAlpha(rim, 0.6f) : rim, rounding, 0, 1.0f); + return; + } // Frosted glass highlight — subtle fill on top if (!active) { ImU32 col = hovered