[Panel-devel] Plasma::Icon highlighting issues

Jason Stubbs jasonbstubbs at gmail.com
Thu Dec 13 15:57:59 CET 2007


Hey all,

Got a couple of patches to fix highlighting issues that can be seen in applets 
using Plasma::Icon, such as the kickoff and lock/logout applets.

The Plasma::Icon changes are:
* Only add the hover decoration if a button is not pressed so that icons that
  share a hover and clicked image still look different (the removed comment
  about there being no visual difference is incorrect)
* Don't display the clicked image when the mouse moves out of the icon's area
  so that the user can see that a release outside of the icon isn't considered
  as a click
* Add a property "delayedRelease" that controls whether the icon will continue
  to appear as pressed after a click has finished, and a release() method to
  restore the icon to normal behaviour.
* Fix mouseMoveEvent to not prevent a click event from happening
* Only pass MouseMove and MouseRelease events to Widget if the initial
  MousePressed event was passed
* Remove redundant event->accept() and event->ignore()
* Call update() manually rather than passing on hover events and expecting
  QGraphicsItem to do it instead as the update() call wasn't happening
* Remove the pressed(bool) signal as kickoff is the only code using it and the
  next patch changes that (and I think that actions being triggered before a
  release on what is essentiall a button widget is a Bad Thing(TM))

The Kickoff changes (for both applet and simpleapplet) are:
* Display the menu on a click (=after release) rather than on mouse down
* Set the icon's delayedRelease property so that the icon appears to stay
  pressed while the menu is visible
* Return the icon to normal behaviour after the menu disappears

And to preempt possible points of concern, ;)
* I first toyed with giving Plasma::Icon a "checkable" property, but decided
  against it as it doesn't fit in well with IconActions
* A second click of the icon will not redisplay the kickoff menu (in either
  applet) as the click is consumed by the menu itself

Any other issues? Ok to commit?

-- 
Jason Stubbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icon-highlighting.patch
Type: text/x-diff
Size: 10812 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071213/9b2adb18/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kickoff-highlighting.patch
Type: text/x-diff
Size: 5108 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071213/9b2adb18/attachment-0003.bin 


More information about the Panel-devel mailing list