Saturday, 25 July 2009

Recommended changes for 0.4 applets

As you may and may not have noticed, a couple of signals were recently added to both AwnIcon and AwnAppletSimple. These are "clicked", "long-press" and "context-menu-popup".

I think it's pretty clear what these do - you no longer need to connect to "button-press-event" (though you can), and switch through event.button, but that's not all. As h4writer (one of our core devs) mentioned some time ago, there are inconsistencies in clicking on the icons. Basically, in the past all applets did an action on the button press - as opposed to button release, which is common for button-type widgets. The clicked signal sorts out this inconsistency and fires when the icon gets the actual button-release event (meanwhile checking if it also got the button-press).
But that's still not all, if you use the clicked signal, you'll actually see that there's a subtle animation - the icon glows slightly while it's depressed - yay for eye-candy!

This way I'd like to appeal to you to make this simple transition in your applets, so that all 0.4 applets use the clicked signal instead of button-press-event.

As for the "context-menu-popup" signal, applets were doing this correctly - because popup menu is supposed to popup on the actual button-press, but it was added anyway for your convenience.

The last of the new signals long-press was added primarily because of taskmanager needs and gets emitted a second after button-press event (if there was no button-release meanwhile). Please don't use this forcefully, it is far from obvious that there can be an action on long-press.

No comments:

Post a comment