From kde-panel-devel Thu Sep 24 08:03:24 2009 From: Charles Wautier Date: Thu, 24 Sep 2009 08:03:24 +0000 To: kde-panel-devel Subject: Re: Problem to use PopupApplet Message-Id: <437a2f810909240103q186c2f2al7ed2b303414df108 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-panel-devel&m=125377945912865 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0072050309==" --===============0072050309== Content-Type: multipart/alternative; boundary=0016e6dab171038bb004744e44f1 --0016e6dab171038bb004744e44f1 Content-Type: text/plain; charset=ISO-8859-1 2009/9/22 Aaron J. Seigo > hi Charles; > > let's keep this on plasma-devel@kde.org. > > On September 21, 2009, Charles Wautier wrote: > > 2009/9/21 Aaron J. Seigo > > > > > 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 > --0016e6dab171038bb004744e44f1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/9/22 Aaron J. Seigo <aseigo@kde.org>
<= blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 2= 04, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> 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/h= iding 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 (wi= th
> > > =A0setPopupIcon) 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 si= de-effects
> > > : 1/ When the plasmoid just have been started, the first cli= ck on the
> > > label show the menu but hide it right away. Then the behavio= ur 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 show= Popup
> > 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 over= ride
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 happ= en for you
with your own applet?

> > it keeps the resize cursor even after you
> > stop resizing? because resizing the applet continues until you le= t 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
> =A0too short : they are different of what they should be (deep black > =A0background 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 ti= me 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 o= n 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 wid= get. The graphic enhancement I observed when setting an icon are only visib= le with the plasmoidviewer, but not when the plasmoid is in KDE environneme= nt, so I suppose it was just an illusion.
Thus I observed what you said :=A0 plasmoid has no responsability in those = bugs, and I'll go back searching :)

Thanks for your help !
<= /div>

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

KDE core developer sponsored by Qt Development Frameworks

--0016e6dab171038bb004744e44f1-- --===============0072050309== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============0072050309==--