[Semi-PATCH] Dolphin - Previews in Tooltips

Simon St James kdedevel at etotheipiplusone.com
Mon Aug 18 20:37:03 BST 2008


Hi Peter,

On Monday 18 August 2008 19:13:50 Peter Penz wrote:
> Hi Simon,
>
> If the non-previews look pixelated, we just have to assure to use the
> correct icon size for the non-previews and center them within the available
> area. I have not tried your patch yet, but I think this should be straight
> forward to fix :-)
>
> > There's still re-sizing
> > happening, but it's strictly downwards (when the aspect of a preview
> > isn't 1:1).
>
> Does resizing make sense at all? From my point of view the problematic
> point with resizing is that the position of the text changes:
> - I hover an item where I'm interested in the permissions.
> - The tooltip appears and my eyes try to find the "permissions" text.
> - Before I can check the permissions, the tooltip gets downsized because
> the aspect of the preview isn't 1:1 -> have to search "permissions"
> again...
>
> Do I miss here something (as said: I did not try your patch yet)?

Ooh - if you've not tried it yet, I'd definitely better show you some 
screenshots before committing as the results are quite ... um ... 
space-consuming :). I've taken some representative shots: the ones with 
the "-padded" suffix are using your suggestion of centering within a 
constant-size square.  The only way I could think of doing this without 
actually re-implementing the paint(...) and sizeHint(...) of 
kformattedballoontipdelegate is to create a transparent PREVIEW_WIDTH x 
PREVIEW_HEIGHT QPixmap and centre the image onto that, which is rather 
clumsy :/

http://etotheipiplusone.com/kde4daily/dolphin-tooltip-previews/aspect-padded.png

http://etotheipiplusone.com/kde4daily/dolphin-tooltip-previews/lol-padded.png

http://etotheipiplusone.com/kde4daily/dolphin-tooltip-previews/not-preview-padded.png

http://etotheipiplusone.com/kde4daily/dolphin-tooltip-previews/lol.png

http://etotheipiplusone.com/kde4daily/dolphin-tooltip-previews/aspect.png

http://etotheipiplusone.com/kde4daily/dolphin-tooltip-previews/not-preview.png

> > The much simpler updated patch is attached: I've had to edit it manually
> > to get rid of some other stuff I'm working on, and hope it hasn't got
> > corrupted. I should probably look into git at some point :)
>
> Great :-) From my point of view you can commit the patch (for sure only if
> Fredrik agrees on the changes of KToolTip and KFormattedBallonTipDelegate).
> Before commiting: Please always add a copyright header for new files like
> DolphinToolTip including your name.

Ok, we'll wait and see what Fredrik says :) I recall from IRC that he disliked 
the approach of forcing a new decoration size in to 
kformattedballoontipdelegate, but I'm not sure whether he considered it 
merely distasteful or a dealbreaker :)

> In the Information Panel a similar approach is used like you suggest:
> * when hovering an item, a timer is started
> * if the timer exceeds, the preview job is started
> * if another item is hovered during the timer is not exceeded the timer
> gets stopped and restarted
> * if another item is hoverd during the preview has already been started,
> the old preview just gets skipped

Good - precedent! I'll work on this later.  This also reduces the amount of 
re-sizing in many common cases.

> We had already a few iterations of the alignment - relying on that the
> y-value is set in a way that m_itemRect is not intersected is not enough
> :-( Also with Dolphin for 4.2 the general icon size can get very huge, so
> that we must take care doing the same checks for the x- and y-alignment.
>
> I had already some working code a few commits earlier, but there have been
> issues with dual screen support and for 4.1 we used a simpler approach. I
> think it would be a good idea digging out the old code for this (svn commit
> 824927 in tooltipmanager.cpp) :-)

Oh, that's a shame :( Unfortunately, I have no experience with or access to 
dual screens - what were the issues, exactly?

Best Wishes,
SImon






More information about the kfm-devel mailing list