Panel icon sizing bug in 4.4

Mike Kasick mkasick-pd at club.cc.cmu.edu
Tue May 25 21:18:56 CEST 2010


On Tue, May 25, 2010 at 10:20:46AM -0700, Aaron J. Seigo wrote:

> kickoff is a popup applet should be handled by PopupApplet and so shouldn't be 
> patched for this.

The "new-style" kickoff is indeed, I don't think the patches touch
the regular LauncherApplet.  The "old-style" kickoff (better name for
this?  simpleapplet?  Class MenuLauncherApplet anyways.) isn't a
PopupApplet hence why I added the code there.

> the PopupApplet patch needs work, however. in PopupApplet::sizeHint, it should 
> probably be something like:
> 
> if (!d->icon) {
>     return Applet::sizeHint(which, constraint);
> }

So actually, I wasn't quite sure if I had to do anything more when
converting iconSize to a QSizeF.  In IconWidget and elsewhere
IconWidget::sizeFromIconSize is used (e.g., icons.cpp:63).

Unfortunately I couldn't use m_icon->sizeFromIconSize in IconApplet (or
d->icon elsewhere) since sizeHint is called the first time before these are
initialized, and I didn't want to muck with the initialization order.  I
checked on my build, and it appears IconWidget::sizeFromIconSize doesn't
actually change the size for these particular icons though, so it's
equivalent to QSizeF(iconSize, iconSize).

Anyways, what I didn't know was if sizeHint is only queried once, or if it
gets queried a couple of times.  If it's only queried once, it needs to
return the "right" size even when the respective IconWidgets are
uninitialized.  Perhaps that's related to the iconChanged bit?

> thanks for the patches, especially revising them in response to feedback;

No problem, wanted to do it right anyways.

> think the easiest thing to do from here will be for ivan and i to triage
> them into svn and get them commited for beta2. cheers :)

Is there a chance this will make it into 4.4.4?  If not, I might want to
grab a copy of the final patch set and see if I can get it slipped into
Debian, since they won't ship 4.5 for the next stable release.

Figure there's likely to be a single SVN commit I can grab?  Otherwise I
can take a look at the commit log and grab out the relevant pieces.

Thanks everyone!

P.S.: While it's on my mind, I think I see another bug in
IconWidget::sizeHint (kdelibs/plasma/widgets/iconwidget.cpp:675,691,696).
The three return lines in this method all take "qMax(...height(), ...height()",
I suspect that's supposed to be "qMax(...width(), ...height()".


More information about the Plasma-devel mailing list