D19432: [text thumbnailer] Use KSyntaxHighlighting for text rendering

Dominik Haumann noreply at phabricator.kde.org
Sun Mar 10 19:39:57 GMT 2019


dhaumann added inline comments.

INLINE COMMENTS

> textcreator.cpp:169
> +            syntaxHighlighter.setDefinition(m_highlightingRepository.definitionForFileName(path));
> +            const auto highlightingTheme = m_highlightingRepository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme);
> +            syntaxHighlighter.setTheme(highlightingTheme);

I saw this review request just now: Using a hardcoded theme is not a good idea. I suggest to use a solution based on the background color. We have the following in our example codeeditor:

  setTheme((palette().color(QPalette::Base).lightness() < 128)
      ? m_repository.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme)
      : m_repository.defaultTheme(KSyntaxHighlighting::Repository::LightTheme));

Could a similar approach be used here as well?

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D19432

To: kossebau, broulik, cfeck
Cc: dhaumann, vkrause, cfeck, kde-frameworks-devel, kfm-devel, alexde, feverfew, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190310/60814c1d/attachment.htm>


More information about the kfm-devel mailing list