fix preview of plain text files when using dark theme
ClosedPublic

Authored by iliakats on Dec 11 2019, 3:46 PM.

Details

Summary

When using a dark theme, plain text files without an associated highlighting theme are rendered in white on a white background (see also bugs 409380 and 406821). This patch forces a re-highlighting of the preview after the theme is set and before it is drawn into the preview area.

Test Plan

opened dolphin, checked several text files for correct preview colors

Diff Detail

Repository
R320 KIO Extras
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
iliakats created this revision.Dec 11 2019, 3:46 PM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptDec 11 2019, 3:46 PM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
iliakats requested review of this revision.Dec 11 2019, 3:46 PM
iliakats added a reviewer: Dolphin.
iliakats updated this revision to Diff 71295.Dec 11 2019, 4:40 PM

performance improvement: only do one round of highlighting (skip the one run in the constructor of QSyntaxHighlighter)

anthonyfieroni accepted this revision.Dec 11 2019, 8:06 PM
This revision is now accepted and ready to land.Dec 11 2019, 8:06 PM
This revision was automatically updated to reflect the committed changes.
meven added a subscriber: meven.Dec 14 2019, 7:22 AM

For reference I had a similar patch https://phabricator.kde.org/D25323 and a potential fix in KSyntaxHighlighting https://phabricator.kde.org/D25328