Fix poor contrast of highlight in search results with dark theme (#1557)

- fixes #1308
This commit is contained in:
eerielili 2024-03-02 12:27:44 +00:00 committed by GitHub
parent 4cc7e076e6
commit c8700b44f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -260,7 +260,8 @@ public class GlobalSearch {
for (; match_info.matches(); match_info.next()) { for (; match_info.matches(); match_info.next()) {
int start, end; int start, end;
match_info.fetch_pos(0, out start, out end); match_info.fetch_pos(0, out start, out end);
markup_text += Markup.escape_text(text[last_end:start]) + "<span bgcolor=\"yellow\">" + Markup.escape_text(text[start:end]) + "</span>"; string themed_span = Util.is_dark_theme(label) ? "<span color=\"black\" bgcolor=\"yellow\">" : "<span bgcolor=\"yellow\">";
markup_text += Markup.escape_text(text[last_end:start]) + themed_span + Markup.escape_text(text[start:end]) + "</span>";
last_end = end; last_end = end;
} }
markup_text += Markup.escape_text(text[last_end:text.length]); markup_text += Markup.escape_text(text[last_end:text.length]);