Fix font preview/thumbnail in dark mode/any theme (fix #3851)

This commit is contained in:
David Capello 2024-11-21 19:00:57 -03:00
parent ff993f1687
commit ad57997482
1 changed files with 5 additions and 3 deletions

View File

@ -114,8 +114,11 @@ private:
generateThumbnail(); generateThumbnail();
if (m_thumbnail) { if (m_thumbnail) {
const auto* theme = app::skin::SkinTheme::get(this);
Graphics* g = ev.graphics(); Graphics* g = ev.graphics();
g->drawRgbaSurface(m_thumbnail.get(), textWidth()+4, 0); g->drawColoredRgbaSurface(m_thumbnail.get(),
theme->colors.text(),
textWidth()+4, 0);
} }
} }
@ -141,9 +144,8 @@ private:
text::FontStyle(), text::FontStyle(),
FontInfo::Flags::Antialias); FontInfo::Flags::Antialias);
const gfx::Color color = theme->colors.text();
doc::ImageRef image = doc::ImageRef image =
render_text(fontInfoDefSize, text(), color); render_text(fontInfoDefSize, text(), gfx::rgba(0, 0, 0));
if (!image) if (!image)
return; return;