[Semi-PATCH] Dolphin - Previews in Tooltips

Peter Penz peter.penz at gmx.at
Mon Aug 18 19:26:08 BST 2008


Am Monday, 18. August 2008 20:04:29 schrieb Simon St James:
> > I also found a bug in the positioning algorithm that the larger previews
> > exposed but which is also present without: in details view, with the
> > right panel removed, it's possible for an item to take up most of the
> > width of the screen, with the result that the tooltip appears
> > half-offscreen all the way to the left in its attempt to avoid being
> > drawn in m_itemRect.  I'll have a stab at fixing this, too.
>
> Something like this should do the trick:
>
> if (x + size.width() - 1 > desktop.right()) {
>         // Any room to the left of the item?
>         if (m_itemRect.left() - size.width() > desktop.left())
>         {
>             x = m_itemRect.left() - size.width();
>         }
>         else
>         {
>             // Move left until we are back onscreen; we'll be horizontally
>             // overlapping m_itemRect, but hopefully the y value will keep
> us // from drawing inside it.
>             x = desktop.right() - size.width();
>         }
>     }

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) :-) 




More information about the kfm-devel mailing list