feat(chat): theme the :drgx: emoji to the accent (was fixed brand colors)

The custom DragonX chat emoji now recolors to the theme like the logo — body =
accent, detail = white on dark skins / on-surface (dark) on light skins — and
re-rasterizes on a theme/dark-light change (moved out of the one-time fixed-color
load into ensureLogoTexture's re-render block). The detail highlights keep it
legible even on accent-tinted outgoing bubbles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-21 14:12:44 -05:00
parent 3d0305a9ca
commit 203967411a
2 changed files with 10 additions and 10 deletions

View File

@@ -1361,13 +1361,6 @@ void App::handleGlobalShortcuts()
// theme accent, so it re-rasterizes whenever the accent or the dark↔light variant changes.
void App::ensureLogoTexture()
{
// DragonX custom chat emoji (":drgx:") — the mark in FIXED brand colors (crimson body + white detail),
// rasterized once. Kept theme-independent so it looks identical for the sender and the receiver.
if (!drgx_emoji_tex_) {
util::LoadTextureFromSvg(embedded::kLogoDragonXSvg, 96, IM_COL32(0xD8, 0x26, 0x52, 0xFF),
IM_COL32(255, 255, 255, 255), &drgx_emoji_tex_, &drgx_emoji_w_, &drgx_emoji_h_);
}
const bool wantDark = ui::material::IsDarkTheme();
const ImU32 logoAccent = ui::material::Primary();
if (logo_loaded_ && wantDark == logo_is_dark_variant_ && logoAccent == logo_accent_)
@@ -1378,6 +1371,13 @@ void App::ensureLogoTexture()
// The SVG's white highlight (detail) stays white on dark skins, but darkens to the theme's on-surface
// colour on light skins so it doesn't wash out against a light card/background.
const ImU32 detailCol = wantDark ? IM_COL32(255, 255, 255, 255) : ui::material::OnSurface();
// ":drgx:" custom chat emoji — themed to the accent like the logo (re-rasterized on theme change).
if (drgx_emoji_tex_) util::DestroyTexture(drgx_emoji_tex_);
drgx_emoji_tex_ = 0; drgx_emoji_w_ = 0; drgx_emoji_h_ = 0;
util::LoadTextureFromSvg(embedded::kLogoDragonXSvg, 96, logoAccent, detailCol,
&drgx_emoji_tex_, &drgx_emoji_w_, &drgx_emoji_h_);
if (logo_tex_) util::DestroyTexture(logo_tex_); // free the previous texture before replacing
logo_tex_ = 0; logo_w_ = 0; logo_h_ = 0;