Bug 117459 - Kate code navigation with zoom-out
Summary: Kate code navigation with zoom-out
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 20:59 UTC by Dirk Möller
Modified: 2012-10-29 06:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Illustration of zoom-out (104.88 KB, image/png)
2005-12-01 21:45 UTC, Dirk Möller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Möller 2005-12-01 20:59:13 UTC
Version:           2.5.0 (using KDE 3.5.0, Kubuntu Package 4:3.5.0-0ubuntu0breezy1 breezy)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-9-386

It would be usefull for code navigation to zoom-out on the fly for having an overview over a large part of the document. The different methods/functions should be seperated by different colors and labeled with their names.
I modified a screenshot to illustrate what i mean:

http://img217.imageshack.us/my.php?image=bildschirmphoto11jk.png

A simple click on a method should zoom in again.
Comment 1 Dirk Möller 2005-12-01 21:45:38 UTC
Created attachment 13723 [details]
Illustration of zoom-out

Here the picture as attachment, because imageshack store picture just 24h
Comment 2 Frerich Raabe 2005-12-01 23:13:52 UTC
I think that's a pretty nifty feature. How about always showing the big white function name right-bottom aligned (I suspect most functions end in lots of '}' or 'end;' or whatever your programming language is - in any case, the indendation decreases, so you probably have less risk of the code overlapping the big function indicator)?
Comment 3 Matthias Granberry 2005-12-01 23:53:05 UTC
This is interesting, but I wonder if it is a good idea to go all rainbow on it.  The more conservative alternate-pastel-colors approach like that used in KListView with the alternateBackground might work better.  Or a list that gets cycled through.

In general it's a pretty exciting idea.  I'd like to see it developed further.
Comment 4 Sandro Giessl 2005-12-01 23:53:24 UTC
*** This bug has been confirmed by popular vote. ***
Comment 5 mauceri 2005-12-02 00:20:50 UTC
I like that Idea and would be happy to see that in a future release...
Comment 6 Raphael 2005-12-02 08:14:02 UTC
How about colouring also the background area of vertical scrolbar ?
The function names could be displayed as tooltips.
Comment 7 saserr 2005-12-02 08:50:46 UTC
This should work great only if zoom out/in is a mouse button combination, so person can zoom out, find and zoom back in without using keyboard and buttons in Kate's toolbar.
Comment 8 Jim Higson 2005-12-02 09:42:36 UTC
On Friday 02 Dec 2005 07:50, saserr wrote:
[bugs.kde.org quoted mail]

Well, the standard way for zooming with the mouse is ctrl+wheel, used by 
almost all programs that support zooming. It also doesn't do anything in kate 
at the momement so would be a good candiadate for this new zoom idea.
Comment 9 Sander Bouwhuis 2005-12-02 10:44:46 UTC
To make this feature more complete, I think it should work the other way around too. Zooming in on a single method could display just that method, maybe (preference?) in a larger font size. Personally, I'd like to see it even more than the zoom-out functionality, as I think it decreases the experienced amount of clutter and distraction in some situations.

There may even be more zoomlevels for blocks, but that probably is overdoing it a bit :)
Comment 10 Sebastian Goth 2005-12-02 10:51:38 UTC
This idea is really pretty cool.
There should also be some key combos like ctrl++ and ctrl+- so that one could keep his hands off his mouse.
Comment 11 Dirk Möller 2005-12-02 11:25:16 UTC
Yes, I also thought of ctrl+mousewheel up/down for zooming in/out. The background colors don't have to go through "all of the rainbow", they just should seperate consecutive functions visibly. And simple key combinations should also be available.
Additionally, when zooming out very far, it's not neccessary to be able to read any word from the code, but to recognise the function structure (or layout? I don't no how to name it), not only function length, but idention and line length.
Comment 12 Jim Higson 2005-12-02 13:52:00 UTC
Few things to consider:

1) If we zoom out to 50% code that filled the width of the editor would now only go halfway. The code could be arranged in two columns to show more at once (ie, lines 50-120 on the left, 121-190 on the right)

2) What about languages like Java, where the whole code is in a container (in this case a class)? Clearly, just highlighting the top-level entities would fail here.

3) Maybe colours should be used to indicate the type of function, and alternating light/dark to seperate them. Some ideas:
          * Public and private functions in different colours (in languages that don't support private as top level, functions starting with an underscore could be considered private)
          * In languages that support overloading, overloaded functions done in different shades of the same colour
          * Calls to a function highlighted in the colour of that function.

4) When zoomed out, hovering over a function could shows information about it in a tooltip (return type, parameters etc) or maybe just the first few lines, preceding (possibly doxygen) comments.
Comment 13 Hamish Rodda 2005-12-05 04:37:02 UTC
Ok, looks like you guys have stirred up some interest ;)

The basic ability to do the highlighting is already present in kde trunk - the code which will become kde 4.  Arbitrary highlighting is implemented, and enables the colouring as shown in http://members.optusnet.com.au/~hamishrodda/kate-arbitrary-highlighting.png and http://members.optusnet.com.au/~hamishrodda/kate-arbitrary-highlighting1.png.  I believe katepart's job should only be to provide the ability; it would be kdevelop and kate plugins' job to use it.

The two other parts to this request would seem to be the zooming, and the overlay of function name.  Zooming is possible now with the "enlarge font" and "shrink font" actions; if there is a wish to have ctrl-mousewheel do this it would be trivial to add.

Overlay of context (eg. function names) is an entirely different matter and will be much less trivial, so if there is consensus that it is essential, a new extension could be provided to do this.
Comment 14 Leo Spalteholz 2005-12-05 20:30:06 UTC
I dont think the zooming should be done by shrinking text. If you shrink text enough to get an overview of your functions, then it's no longer large enough to be readable, so it might as well not be there.  It's better to "zoom" out by just showing the first few lines of the function, or the doxygen docs for it.  Even just one linne with the name of the function would be very useful.  

Basically, all I would like to see is a key combination to do the equivalent of folding all functions in the file.  Then when you click on any of those folded functions, it unfolds all of them, and you're at that function.  To be useful, it should be possible to unfold the function by clicking anywhere on its line, not just on the little folding box.
Comment 15 Jim Higson 2005-12-05 20:37:16 UTC
> then it's no longer large enough to be readable, so it might as well not be there.

I disagree. Most of the time I can see patterns in code I'm familiar with enough to identify certain bits without actually being able to read it.
Comment 16 Geoffrey Powell-Isom 2005-12-06 08:55:50 UTC
> 2) What about languages like Java, where the whole code is in a container (in this case a class)? Clearly, just highlighting the top-level entities would fail here. 

How about putting classes in colored boxes?
Comment 17 Christoph Cullmann 2012-10-29 06:57:36 UTC
We have no a outline minimap on the right (optional) in kate.git master, that should do the trick.