Smaller KDialogs if needed

Albert Astals Cid aacid at kde.org
Wed Jun 25 21:47:32 BST 2008


A Dimecres 25 Juny 2008, David Faure va escriure:
> On Sunday 22 June 2008, Albert Astals Cid wrote:
> > A Diumenge 22 Juny 2008, Olivier Goffart va escriure:
> > > Le samedi 21 juin 2008, Albert Astals Cid a écrit :
> > > > KDialog uses the mainwidget sizeHint to calculate it's
> > > > minimumSizeHint, this results in BIG KDialogs and bad situations like
> > > > for example $ keditfiletype text/html
> > > > not fitting in a 1024x768 screen.
> > > >
> > > > The attached patch first uses sizeHint and if the calculated
> > > > minimumSizeHint is bigger than 90% of available screen rect
> > > > recalculates the minimumSizeHint using children's minimumSizeHint.
> > > >
> > > > That gives me a keditfiletype that fits nicely in a 1024x768 screen.
> > > >
> > > > Comments?
> > >
> > > Don't you think kdialog should always compute the minimum sizehint from
> > > the minimum size hint of it's contents?
> >
> > It would seem sane yes, but if you do that, you'll end up with uglier
> > dialogs by default, many components define a minimum sizehint that is
> > really minimum, so that's why i just switched to using minimum sizehint
> > if it does not fit.
>
> I don't understand.
>
> Yes, minimumSizeHint() is really minimum, but by default you get the
> sizeHint() of all the widgets... so what's the problem with
> minimumSizeHint() being really minimum? As long as you don't resize down
> the dialog, you don't see how small things can get... Do you mean that you
> want to prevent people from making dialogs very small? Normally if all
> minimumSizeHint()s (and size policies) are correct, the dialog should still
> be usable even when using the minimumSizeHint of all widgets....

Right, notice how it's not me who enforced sizeHint there, i just came to 
de-enforce it when it results in a too big size.

You should be talking to whoever feels responsible enough for that piece of 
code that it's not me.

Albert




More information about the kde-core-devel mailing list