[PATCH] Tooltip alignment (and all the other popups too)

Marco Martin notmart at gmail.com
Mon Jan 21 12:41:04 CET 2008


On Monday 21 January 2008, Aaron J. Seigo wrote:
> On Friday 18 January 2008, Marco Martin wrote:
> > this is another version: i made a new function popupPosition() to calc
> > the position, because this is also badly needed for all the popups like
> > kickoff and device notifier. because at the moment (at least for kickoff)
> > the case of a lateral panel is not managed at all, this should use sane
> > positions both in the panel and in the desktop
>
> looks good. it is interesting that the window manager wasn't catching this
> an moving the window to an on-screen location. if it truly isn't, then the
> patch should also take that into consideration. however, i think the window
> manager is *supposed* to do that, so .. this patch looks good to me.
strangely enough the window manager does move popups in a position on screen 
but these tooltip werent't
but even if they are on screen they need some specific code to appear decent 
be cause for instance in a vertical panel on the right they covered the 
widget so the tooltip start blinking :)

>
> style-wise:
>
> please don't separate lines like these:
>
> +             return QPoint(globalPos.x(),
> +                           globalPos.y()+(int)size().height());
>
> onto two lines, and add some space around the + operator. this:
>
>             return QPoint(globalPos.x(), globalPos.y() +
> (int)size().height());
>
> fits just fine. we do all have modern screens and fonts that give us 100
> characters, no? ;)

yeah, i still had not grasp everything, for somebody more than 80 col is still 
a mortal sin today so i always don't know how to behave :)

> and not that it *overly* matters, of course, but one can always raise the
> possibility of avoiding the allocation of another object here by turning
> this:
>
> +    QPoint viewPos = view()->mapFromScene(scenePos());
> +    QPoint globalPos = view()->mapToGlobal(viewPos);
>
> into:
>
> +    QPoint pos = view()->mapFromScene(scenePos());
> +    pos = view()->mapToGlobal(viewPos);
>
> since viewPos isn't used again and the code is one right after the other in
> usage, i don't consider this overly uglifying.

ok, done the changes and committed :)
can i start to change the applets that uses popup menus to use 
popupPosition()?

Cheers,
Marco Martin





More information about the Panel-devel mailing list