D22854: Added support for configurable font styles for syntax highlighting

Marcin DÅ‚ubakowski noreply at phabricator.kde.org
Wed Jul 31 12:46:52 BST 2019


mdlubakowski created this revision.
mdlubakowski added a reviewer: KDevelop.
mdlubakowski added a project: KDevelop.
Herald added a subscriber: kdevelop-devel.
mdlubakowski requested review of this revision.

REVISION SUMMARY
  Related to BUG: 395856, BUG: 410213
  
  **Problem:**Everybody who uses KDevelop probably noticed that editor font styles (mainly color) for several types cannot be changed. This is because KDevelop makes use of KTextEditor, but at the same time enhances provided highlighting with its own module, which has hardcoded color values.
  I think it is not good that modern IDE doesn't provide such a basic customization, so I decided to fix for myself, which ultimately grew into this patch.
  
  **What does this patch change:** Adds new settings page to the Editor tree, which allows to customize font style for several previously hardcoded types like class names, namespace names, methods, enumerators and so on.
  As for the code aspect, I created a new module ConfigurableSyntaxStyle, which acts as repository for all the styles and can be easily extended with new entries if needed.
  I tried not to touch existing code too much, so the only changes in other modules are those that adapt highlighting to use the new styles model. This also means that color blending works the same way as it always did (Local/Global Colorization Intensity settings).
  
  **What else can be done:**
  Add more customization options (selected background color, selected text color etc.)
  Integrate the settings with KTextEditor settings panel - I didn't find a way to do it from KDevelop code, so in the end I just added it as an additional page. But maybe it is possible - needs investigation.
  Integrate "Semantic Highlighting Options" from "Language Support" page into new settings. It would probably be a good idea since these options affect highlighting.
  Group options into categories.
  
  If you have any suggestions, please leave a comment.
  
  I'm attaching some screenshots so you can see how it looks:
  F7125899: Screenshot_20190731_122905.png <https://phabricator.kde.org/F7125899>
  
  F7125898: Screenshot_20190731_122928.png <https://phabricator.kde.org/F7125898>

REPOSITORY
  R32 KDevelop

BRANCH
  configurable-syntax-styles

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

AFFECTED FILES
  kdevplatform/language/CMakeLists.txt
  kdevplatform/language/highlighting/codehighlighting.cpp
  kdevplatform/language/highlighting/colorcache.cpp
  kdevplatform/language/highlighting/colorcache.h
  kdevplatform/language/highlighting/configurablesyntaxstyle.cpp
  kdevplatform/language/highlighting/configurablesyntaxstyle.h
  kdevplatform/shell/CMakeLists.txt
  kdevplatform/shell/settings/syntaxstylepreferences.cpp
  kdevplatform/shell/settings/syntaxstylepreferences.h
  kdevplatform/shell/settings/syntaxstylepreferences.ui
  kdevplatform/shell/uicontroller.cpp

To: mdlubakowski, #kdevelop
Cc: kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190731/75462d82/attachment.html>


More information about the KDevelop-devel mailing list