2009/9/22 Aaron J. Seigo <aseigo@kde.org>
hi Charles;

let's keep this on plasma-devel@kde.org.

On September 21, 2009, Charles Wautier wrote:
> 2009/9/21 Aaron J. Seigo <aseigo@kde.org>
>
> > On September 21, 2009, Charles Wautier wrote:
> > > What makes this plasmoid unusual is that the Popup showing/hiding is
> > > not controlled by an icon as it's supposed to be, but by a click on the
> >
> > label.
> >
> > > To realize that, I tricked, by not setting the PopupIcon (with
> > >  setPopupIcon) as I'm supposed to do (a known trick on #plasma)
> >
> > technically, it's not a trick :)
> >
> > > The problem is : it seems that this trick has undesirable side-effects
> > > : 1/ When the plasmoid just have been started, the first click on the
> > > label show the menu but hide it right away. Then the behaviour become
> > > normal.
> >
> > sounds like a bug in your code, or something we haven't made obvious
> > enough in
> > the API.
> >
> > you can either override the mousePressEvent in your applet itself or, if
> > the
> > label in your plasmoid is a separate widget then simply call showPopup
> > when it's clicked.
>
> That is exactly what I do (slot which shows a popup ; its never called -
> maybe because I choose a wrong signal *

yes, this would be a bug in your code somewhere.

> - but anyway, the popup does appear
> when clicking on any surface outside the button (c.f. screenshot))

that would be because PopupApplet provides that for you. you can override
mousePressEvent in your PopupApplet subclass to prevent that.

> > > 2/ When resizing, the mouse cursor keeps the form of the
> > > resizing-double-arrow even when we hover the popup
> >
> > when resizing what, the applet?
>
> When I resize the Popup, so the cursor is transformed in double-arrow, the
> cursor keeps this form when I finish resizing (button released).

i can't confirm this with other PopupApplets. does this only happen for you
with your own applet?

> > it keeps the resize cursor even after you
> > stop resizing? because resizing the applet continues until you let go of
> > the
> > mouse button, even if the cursor passes over another window.
> >
> > > 3/ The scroll bars are ugly
> >
> > which scroll bars?
>
> the scrollbars of the popup (which contains a treeview) when the size is
>  too short : they are different of what they should be (deep black
>  background and grey scroll)

we don't re-style all scrollbars from all QWidgets put into
QGraphicsProxyWidgets. so that is to be expected. one needs to either use a
proper QGraphicsWidget or live with some odd ugliness here and there.

> What is curious is : if I remove the code concerning the Applet itself
> (opposed to the Popup), and I set an Icon, those bugs disappear.

yes, sounds like bugs in your code. unfortunately i don't have time to review
your code line by line and debug it with/for you, but if you can provide
simple test cases that do show bugs in libplasa i'm more than happy to address
those on a case by case basis.

I made more tests on the plasmoid, and indeed the popup opens correctly if I change the widget it is supposed to display, so I guess the fault rewards to my original widget. The graphic enhancement I observed when setting an icon are only visible with the plasmoidviewer, but not when the plasmoid is in KDE environnement, so I suppose it was just an illusion.
Thus I observed what you said :  plasmoid has no responsability in those bugs, and I'll go back searching :)

Thanks for your help !

--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks