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

List:       kde-core-devel
Subject:    Re: KDialog & kcmshell
From:       Espen Sand <espen () opera ! com>
Date:       2001-01-16 9:06:27
[Download RAW message or body]

On Tue, 16 Jan 2001, Matthias Kiefer wrote:
> Am Dienstag, 16. Januar 2001 00:08 schrieb Waldo Bastian:
> > On Monday 15 January 2001 13:35, Stephan Kulow wrote:
> > > There is no code calling resize(false within kdialogbase and this
> > > whole class is private to KDialogBase and there is no way to
> > > change this sameSize behaviour. I hardcoded false and it unbroke
> > > kcmshell.
> > > I wonder who would want all buttons to have the same size, so
> > > I would change it to call =false before 2.1 if noone speaks up
> >
> > Well.. if you have e.g. "Yes" / "No" or "Yes"/"No"/"Cancel" it looks much
> > better if they have the same size. The problems start if there is one
> > button that is much bigger than the rest.
> I also vote for having a default behaviour of having different sized buttons. 
> Otherwise we will have a lot of dialogs, that are not usable on small 
> displays. For example have a look at the KNewsTicker preferences dialog with 
> e.g. german translation. It uses almost my whole screen, which is 1152 pixel 
> wide.
> 
> What about using buttons with the same size in the Constructor "for a message 
> box mode where the buttonMask can only contain Yes, No, or Cancel" and when a 
> kdialogbase with the other constructors is created, using buttons with 
> different sizes?

Please, no different sized buttons as the default mode. In most cases 
uni size buttons looks better. Anyway:

I would prefer that one added a function named 
KDialogBase::setMultiSizeButtons( bool multiSize ) and stored the 
value in a flag. The flag state can be identified as a flag in the enum
ButtonCode and be stored in the private int SButton::mask. This should 
not violate b/c, right?

Here is what I think we have to do (I have no working code now at the moment)

1) enum ButtonCode gets a new member:  MultiSize = 0x40000000

2) New public function. The flag state can be set in the constructors as well
because we use the std. button mask, but this function allows that state to be
set at any time:

void KDialogBase::setMultiSizeButtons( bool state )
{
	mButton.mask = state ? mButton.mask|MultiSize : mButton.mask&~MultiSize;
	mButton.resize( !(mButton.mask&MultiSize), 0, spacingHint(),
	mButtonOrientation ); }

3) Every occurence of the code below must be changed (trivial)

mButton.resize( true, 0, spacingHint(), mButtonOrientation );
to:
mButton.resize( !(mButton.mask&MultiSize), 0, spacingHint(), mButtonOrientation);


-- 
Espen Sand
espen@opera.com

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

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