[kde-guidelines] Possible guidelines for buttons with menus
Aurélien Gâteau
agateau at kde.org
Fri Aug 2 14:08:11 UTC 2013
Hi,
As you may know, I am contributing to the KDE Frameworks project, which aims
at splitting the existing Qt4-based kdelibs into separate, finer-grained, Qt5-
based components. Another objective of this project is to get some of the
features KDE developers added to Qt widgets back into Qt itself.
One of those features was "delayed menus" for buttons. When used on a button,
then a short click on the button triggers a default action, while holding the
mouse pressed on the button shows a menu with more actions. Qt provides this
feature for toolbar buttons but not for regular buttons (QPushButton).
in kdelibs, KPushButton extends QPushButton and add this delayed menu feature,
so the original task was to implement the same in QPushButton, so that we
could get rid of KPushButton. After a bit of research, we found out this
feature was very seldom used and we felt it was surprising: buttons with
delayed menus look like menu-buttons (buttons where a short click always show
a menu) but behave differently.
Here is an example of such a button: Kate session dialog. To get this dialog
to show, open the config dialog, go to Application > Sessions, and select
the "Manually choose a session" radio button. Now restart Kate, the dialog
should appear. It looks like this:
http://6g6.eu/sih0-kate-session-dialog-1.png
Clicking the "New Session" button creates a new session. When you hold down
the mouse button on it, you get this menu:
http://6g6.eu/sih0-kate-session-dialog-2.png
The KDE Frameworks project maintains a porting document which suggest
developers alternatives for features which are going away. What should we
suggest to developers using this feature? A generic solution would be
recommending the use of a plain menu button, but I am not sure if it is always
practical since it means the default action will require two clicks instead of
one.
Aurélien
More information about the kde-guidelines
mailing list