D19432: [text thumbnailer] Use KSyntaxHighlighting for text rendering

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Sun Mar 10 20:10:58 GMT 2019


kossebau added inline comments.

INLINE COMMENTS

> dhaumann wrote in textcreator.cpp:169
> 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?

For the thumbnail the code is rendering on a paper-like canvas, which is hard-coded as well (see lines above with `QColor ( 245, 245, 245 ); // light-grey background`). To simulate a print-out, for what I guess or would have done myself.
So with that using also a hard-coded theme should be fine, or?

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/5677af05/attachment.htm>


More information about the kfm-devel mailing list