[Semi-PATCH] Dolphin - Previews in Tooltips

Simon St James kdedevel at etotheipiplusone.com
Mon Aug 18 19:04:29 BST 2008


> 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();
        }
    }




More information about the kfm-devel mailing list