[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Inline widgets in the editor view
From:       Dominik Haumann <dhaumann () kde ! org>
Date:       2014-06-09 12:50:39
Message-ID: 1448481.vyTQPx1zBm () eriador
[Download RAW message or body]

On Monday 09 June 2014 10:48:11 Kevin Funk wrote:
> Hey guys,
> 
> Working a bit with Coverity (static analysis tool, [1]) lately, I've come
> across this nice way [2] of reporting errors. Xcode has a similar way of
> reporting errors [3].
> 
> I think, having some basic infrastructure for displaying this kind of inline
> widgets would be beneficial not just for KDevelop land.
> 
> How hard would it be implement something like that for Kate?

Rendering text lines is line-based. We get the text layout from Qt (Scribe).
Currently, there is the assumption that each line has the same height 
(obtained through KateRenderer). Hence, given the layouts of each line (think 
of dynamic word wrap enabled), we know exactly how many lines are visible in 
total on screen. This assumption is applied in several places, e.g. rendering 
the KateIconBorder/code folding or printing. Maybe also scrolling is affected. 
Search for "lineHeight" and/or "fontHeight" to find code that depends on this.

What would be required to enable embedded widgets is:
- add public a KTE::View interface to allow adding a single (multiple?) 
  widget to a line
- a hash to lookup whether there is a widget attached to a line
- fix all code that assumes a line has fixed height

> Obvious advantages of these inline widgets compared to other solutions:
> * Information text is close to the range it's attached to
> * The widget doesn't hide other editor contents
>   (as opposed to some tooltip solution)
> * No user interaction required to retrieve the information text
>   (it's always there)

These are advantages, yes. But what are the applications?

Kile could show embedded formulas, for instance. Any other? ;)

> Greets
> 
> [1] http://www.coverity.com/
> [2] http://security.coverity.com/static/media/img/goto-fail.png
> [3]
> http://richarddingwall.name/wp-content/uploads2/2008/06/xcode-build-error.p
> ng

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic