RFC: An action class to ease implementation of show/hide-like actions

todd rme toddrme2178 at gmail.com
Fri Sep 10 23:02:08 BST 2010

2010/9/10 Aurélien Gâteau <agateau at kde.org>:
> Hi,
> After putting some work on toggle buttons in the HIG [1], I started to
> look around at applications which were not complying with this new
> addition to the guidelines. I realized lots of applications misuse
> KToggleAction and KToggleAction::setCheckedState() to create actions
> like "Show/Hide Sidebar": they create toggle actions which change their
> labels, so they look like this:
> [ ] Show Sidebar
> [x] Hide Sidebar
> This is even worse when used in a toolbar because when the sidebar is
> visible you end up with a button which says "Hide Sidebar" and stays down.
> One of the solutions to this is to keep the same label, regardless of
> the visibility of the UI element. This is the easiest solution, but it
> does not feel as intuitive in my opinion as changing the label,
> especially in menus.

This may have already been addressed, but what about just setting the
label to "Sidebar".

More information about the kde-core-devel mailing list