KTextEditor : best way to add background vertical guide lines?

René J. V. Bertin rjvbertin at gmail.com
Fri Apr 21 08:52:37 UTC 2017


Dominik Haumann wrote:

Hi Dominik,

> This discussion belongs to kwrite-devel at kde.org.

Forgive me if I prefer not to subscribe to another ML just yet...

> The KTextEditor::View can only display one vertical indicator.
> Is that what you mean?

I didn't know that, I looked for ways to activate margin indicators but couldn't 
find any. What's the name of the method to call?

> What exactly is your approach?

The general context of my question is KDevelop's commit message editor window. 
It uses a highlighter delegate to give feedback about layout *guidelines* that 
are based on KDE's commit message rules. Meaning there's a preferred length 
limit for the title, which should be followed by an empty line and then by a 
summary that has suggested soft and hard line length limits.

All that information is currently conveyed via spellchecking style underlining 
with different colours that comes in addition to underlining by the 
spellchecker. Bad design (and a lousy implementation at that).

I've suggested using other font attributes to draw attention when text exceeds 
one of those limits but they were rejected (not entirely without reason). Before 
I give up I'd like to experiment with displaying margin lines, a priori to be 
(de)activated in the highlighter class to avoid having 3 lines visible at all 
times.

Other approaches could be possible too (placeholder text that's erased 1 
character at a time for instance) so maybe I could create a wishlist ticket on 
BKO to allow brainstorming with a select(ed) audience?

R.



More information about the Kde-frameworks-devel mailing list