Monday, May 21, 2007

KPassivePopup Comic style

A KPassivePopup is a notification that appears briefly on your screen and you don't have to do anything with it except read it. It provides you some information about your application (I must say that I don't like them when they are used at the start of an application like yakuake or Katapult as I launch many apps and I never have time to read them hence I then miss some important info like the shortcut for Katapult...).
In KHangman, I use KPassivePopups to tell the user that the letter he/she entered has already been guessed. The popup is in Comic style
popup->setPopupStyle( KPassivePopup::Balloon );
and is prettier than a plain rectangle. It looks like that:


However on KDE4 there is something broken and it looks like that:



The code that breaks it is in KPassivePopup::updateMask() method and will probably be a one liner. However neither Pino nor me managd to find the solution so far.
We made 2 changes that improve things:
line 469 QBrush brush( Qt::color1, Qt::SolidPattern );
instead of
QBrush brush( Qt::white, Qt::SolidPattern );
and line 475:
path.arcTo(corners[i].x(),corners[i].y(),40,40, i * 90 , 90);
instead of
path.arcTo(corners[i].x(),corners[i].y(),40,40, i * 16 * 90 , 16 * 90);
(QPointArray to QPainterPath).

Will you be the one who will fix KPassivePopup in Balloon style?

No comments: