Review Request: Document switcher plugin improvement

Jarosław Sierant jaroslaw.sierant at gmail.com
Mon Dec 10 21:08:41 UTC 2012



> On Dec. 9, 2012, 3:30 p.m., Andreas Pakulat wrote:
> >

The purpose of this changes is to make file list view as wide it is required (adjust to the content).
Currently in some cases there is a problem to see whole path to file (it is really annoying when I have to use mouse for the vertical scroll).


> On Dec. 9, 2012, 3:30 p.m., Andreas Pakulat wrote:
> > plugins/documentswitcher/documentswitcherplugin.cpp, line 65
> > <http://git.reviewboard.kde.org/r/107628/diff/2/?file=97530#file97530line65>
> >
> >     This should be three dots to indicate an elide. Extra points if you could re-use Qt functionality for eliding instead of doing it manually. I'm not sure what the best way to do that would be at the moment though (maybe itemviews can do this automatically, otherwise may check what QLabel uses or so).
> >     
> >     Also this algorithm has the downside that it elides all path parts and does not give you a guarantee that the resulting string really is smaller than 80 characts. It also may elide more than necessary, which means loss of information.

I try to some how make paths shorter, but may be it is not necessary here (only homePath replacement would be enough). What do you think?
I want to show the user as much as it is possible.

Until width of view does not reach screen width there is no problem.

Problem is when item is longer than screen width.
There is simple solution.
When max list view size will be the same as the screen size scrallingArea take care of situation when items are longer then screen width.
Is it OK for you?


> On Dec. 9, 2012, 3:30 p.m., Andreas Pakulat wrote:
> > plugins/documentswitcher/documentswitcherplugin.cpp, line 117
> > <http://git.reviewboard.kde.org/r/107628/diff/2/?file=97530#file97530line117>
> >
> >     Isn't there an itemview method to resize contents to the needed size?

I'm not sure if I understand you correctly. I want to automatically resize window to content not opposite.
I have no big experience in QT programming but I couldn't find an easy solution.

There is a problem to get correct size of the list view item.
In current implementation sizeHint is incorrect (Qt do not calculate size on its own).
So I have to calculate it manually based on the content.
I use it to resize the window.

I can reimplement sizeHint method in DocumentSwitcherTreeView class (it would be the pretty solution).
But there will be additional loop to calculate proper width.
What do you think about it?


- Jarosław


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107628/#review23204
-----------------------------------------------------------


On Dec. 7, 2012, 5:25 p.m., Jarosław Sierant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107628/
> -----------------------------------------------------------
> 
> (Updated Dec. 7, 2012, 5:25 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> Document switcher window width is automatically calculated base on content (auto adjust to longest item). Current screen width is upper bound of the window width.
> 
> Code duplication has been removed (methods walkForward/walkBackward).
> 
> A path to the file on items list can be truncated if it is too long (threshold=80).
> 
> 
> Diffs
> -----
> 
>   plugins/documentswitcher/documentswitcherplugin.h 0924e81 
>   plugins/documentswitcher/documentswitcherplugin.cpp d457a5a 
> 
> Diff: http://git.reviewboard.kde.org/r/107628/diff/
> 
> 
> Testing
> -------
> 
> Only manual tests are done.
> 
> 
> Thanks,
> 
> Jarosław Sierant
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121210/c1923b25/attachment.html>


More information about the KDevelop-devel mailing list