[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Support in KToggleAction for toggling the text itself
From:       Martijn Klingens <klingens () kde ! org>
Date:       2004-02-08 19:33:03
Message-ID: 200402082033.03177.klingens () kde ! org
[Download RAW message or body]

On Sunday 08 February 2004 15:17, David Faure wrote:
> Your suggestion for a method name sounds strange though, most of the kdeui
> API that takes guiitems doesn't have GuiItem in the name (e.g. void
> setButtonOK( const KGuiItem &item = KStdGuiItem::ok() );

True... in fact I wrote those methods myself in n7y, so I should have done 
better this time as well ;)

> > Question is then what a null pixmap means, use the 'normal' pixmap, or no
> > pixmap at all, since both have their uses.
>
> Hmm. I think the usual cases are
> 1) to have no pixmap at all
> 2) to switch the pixmap to another one (e.g. fullscreen action)
> 3) to keep the same pixmap (e.g. 'show menubar' action).
> I can't see a common use case in having a pixmap in one state and none in
> the other state.

Oh, wait... I mistakenly thought you needed to call the method again when 
toggling the action. Indeed you can determine the heuristics of the 'main' 
GUI item.

That would be:

- If the main item has no icon the checked state has none either.
- If the main item has an icon and the checked one has not, the item stays the
  same
- If both provide an icon, the appropriate one is shown

> "state"? hmm, interesting.... setCheckedState( const KGuiItem & ) ?

Fine with me :)

-- 
Martijn
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic