Dark mode

This commit is contained in:
GenevensiS
2025-10-09 17:57:20 +02:00
committed by GitHub
parent 78b93e5701
commit 513612cd0e
76 changed files with 323 additions and 144 deletions
+10 -3
View File
@@ -12,16 +12,23 @@
// ----------------------------------------------------------------------------- : FontTextElement
void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end) const {
void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end, bool native_look) const {
if ((what & draw_as) != draw_as) return; // don't draw
// text
String text = content.substr(start - this->start, end - start);
if (!text.empty() && text.GetChar(text.size() - 1) == _('\n')) {
text = text.substr(0, text.size() - 1); // don't draw last \n
}
// draw
// draw
Color font_color = font->color;
RealSize margin(0, 0);
if (native_look) {
font->color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
margin = RealSize(1., 0);
}
dc.SetFont(*font, scale);
dc.DrawTextWithShadow(text, *font, rect.position());
dc.DrawTextWithShadow(text, *font, rect.position() + margin);
if (native_look) font->color = font_color;
}
void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const {