KToggleAction in menus

David Faure faure at kde.org
Sun May 6 21:39:38 BST 2007

On Tuesday 01 May 2007, Thomas Zander wrote:
> Most people don't know if the text shows the current state or the state we get after clicking on it.
Well when the text is phrased like an action ("Hide Menubar") it's pretty clear, no?

Quoting my original post about it:
> The problem:
> --------------
> Toggle actions plugged into menus currently toggle a checkmark in front of
> the menu item. This is typically used with a text that represents a state
> (e.g. "View/Frame Borders").
> But this is usually ambiguous (if I see "Case Insensitive Sort" in a menu,
> does that mean it's currently sorting that way or that one should click on
> it to sort that way?).
> Better is to use verbs, to describe actions. We do so already for e.g.
> "Show menubar". However this is even worse currently: when the menubar is
> shown, the menuitem still says "show menubar", which is a really wrong text
> for a menuitem hiding it.

To which GĂ©rard Delafond added:
> 1) Currently, KDE is inconsistent :
> -some programs show "Start/Stop" (Horrible)
> -some others "(x) Start" (most of them)
> -some others "Start" when it is stopped, and "Stop" when it is started (Eg
> : KStars)
> 2) I think the (x) shows a misunderstanding of what a menu item is for.
> IMHO, a menuitem is for acting, not for getting information. the
> information should be for example in the status bar.
> If you use a Toggle menu, it is harder to know the status of the item (you
> must say "if it says "Start", it means that it is stopped").
> But toggle menus are easiear to understand for acting. I want to start, I
> click on "Start". I want to stop, I click on "Stop".


I do agree that something needs to be fixed, the current kde4 behavior is buggy since
the text changes -and- a checkbox appears, it should of course be one or the other.
However I don't think that reintroducing all the problems (listed above) that setCheckedState
fixed, is a good idea. It's nice that Qt4 lets us have checkbox + icon, but it doesn't change
the problem that most menuitems describe an action and toggleactions with a checkbox
describe a state instead of an action, which is pretty consistent and unintuitive.

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list