KIconButton sizes

David Faure faure at kde.org
Mon Feb 4 20:45:56 GMT 2008


On Tuesday 05 February 2008, Lukas Appelhans wrote:
> Am Montag, 4. Februar 2008 07:02:59 schrieb David Faure:
> > On Saturday 02 February 2008, Lukas Appelhans wrote:
> > > Hi!
> > > The attached Patch adds the functionality to KIconButton-class to only
> > > set the Icon-Size for Dialog or Button.
> > > For example: We in KGet need a Size of 16x16 for the Button, which looks
> > > pretty bad in the Dialog...
> > >
> > > Any objections or comments?
> >
> > I don't understand, buttonIconSize/setButtonIconSize is already available
> > as iconSize/setIconSize(QSize) (inherited from QPushButton), and
> > setDialogIconSize is already available as setIconSize(int) (which also
> > calls QPushButton::setIconSize(QSize)).
> > Ah! So the real problem is that KIconButton's setIconSize method clashes
> > with QPushButton's setIconSize since they have different meanings. Damn we
> > should have renamed it for 4.0.
> >
> > So... you want a dialog that shows large icons, but a button that shows a
> > 16x16 icon?
> >
> > In that case a solution is to call button->setIconSize(QSize(16,16))
> > *after* calling button->setIconSize(int) if you call it at all.
> > To make 
> > this more obvious we could have a setButtonIconSize indeed, but: * in a way
> > that makes it work also if setIconSize(int) is called afterwards * and I
> > don't see a need for setDialogIconSize... we end up with too many redundant
> > setters.
> Ok a new patch is attached

Thanks, looks good to me.

-- 
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