<table><tr><td style="">mdlubakowski created this revision.<br />mdlubakowski added a reviewer: KDevelop.<br />mdlubakowski added a project: KDevelop.<br />Herald added a subscriber: kdevelop-devel.<br />mdlubakowski requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22854">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Related to BUG: 395856, BUG: 410213</p>
<p><strong>Problem:</strong>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.<br />
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.</p>
<p><strong>What does this patch change:</strong> 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.<br />
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.<br />
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).</p>
<p><strong>What else can be done:</strong><br />
Add more customization options (selected background color, selected text color etc.)<br />
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.<br />
Integrate "Semantic Highlighting Options" from "Language Support" page into new settings. It would probably be a good idea since these options affect highlighting.<br />
Group options into categories.</p>
<p>If you have any suggestions, please leave a comment.</p>
<p>I'm attaching some screenshots so you can see how it looks:<br />
<a href="https://phabricator.kde.org/F7125899" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F7125899: Screenshot_20190731_122905.png</a></p>
<p><a href="https://phabricator.kde.org/F7125898" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">F7125898: Screenshot_20190731_122928.png</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>BRANCH</strong><div><div>configurable-syntax-styles</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22854">https://phabricator.kde.org/D22854</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kdevplatform/language/CMakeLists.txt<br />
kdevplatform/language/highlighting/codehighlighting.cpp<br />
kdevplatform/language/highlighting/colorcache.cpp<br />
kdevplatform/language/highlighting/colorcache.h<br />
kdevplatform/language/highlighting/configurablesyntaxstyle.cpp<br />
kdevplatform/language/highlighting/configurablesyntaxstyle.h<br />
kdevplatform/shell/CMakeLists.txt<br />
kdevplatform/shell/settings/syntaxstylepreferences.cpp<br />
kdevplatform/shell/settings/syntaxstylepreferences.h<br />
kdevplatform/shell/settings/syntaxstylepreferences.ui<br />
kdevplatform/shell/uicontroller.cpp</div></div></div><br /><div><strong>To: </strong>mdlubakowski, KDevelop<br /><strong>Cc: </strong>kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>