How can I fix KCMultiDialog so it stops resizing?

Matthias Kretz kretz at kde.org
Sun Sep 30 11:48:48 BST 2007


On Sunday 30 September 2007, Adam Treat wrote:
> On Saturday 29 September 2007, Matthias Kretz wrote:
> > On Sunday 30 September 2007, Adam Treat wrote:
> > > Konqueror's configuration dialog is not behaving well.  It is a
> > > KCMultiDialog with several modules loaded.  When the dialog is
> > > initially shown, the tree widget on the left is not shown, but then
> > > pops up a second later.  This is visually jarring.
> >
> > Hmm, you're sure this is a problem with KCMultiDialog? Trying "kcmshell
> > fonts style" I don't see this behaviour.
>
> Konq only uses KCMultiDialog and loads various KCModules.  So yah, pretty
> sure this isn't a KSettings::Dialog only problem.

Ok, once my KDE installation is usable again I'll take a look.

> > AFAIK this is a problem of only KSettings::Dialog. And I sure tried to
> > fix it but did not succeed. The issue is lazy initialization: the
> > structure on the left is only created in KSettings::Dialog::showEvent (as
> > this is a non-spontaneous show it should be called before it is shown).
> > In there it first calls setUpdatesEnabled(false), then the pages are
> > filled in and then updates are reenabled. Still it does not what I
> > expected.
> >
> > If the pages are not lazy initialized then the creation of the
> > KSettings::Dialog object becomes more expensive, but perhaps that's what
> > we need to do?
>
> Yes, I think that is what we need to do.  We need to know the
> minimumSizeHint() of the entire dialog and the only way to know that is to
> create everything.

You want to go a step further and load all KCMs? That's very expensive! I'd 
rather have a resizing dialog that shows up in <1s than one that doesn't 
resize but takes 10s to pop up.

The only other thing I can think of is to enforce a size of the dialog and 
KCMs that don't fit get scrollbars. I find that worse than a resizing dialog, 
though.

> Ok, so then we still need to know the KCM with the largest
> minimumSizeHint() so we can show our dialog at the correct size to begin
> with.  That way it won't grow any larger when you click around on different
> KCM's.

If you have a policy for your KCMs that they have to fit into 400x400, then 
you can setGeometry on the dialog so that no resize is necessary. Perhaps 
this could use a helper function to make it easier to ignore all the margins 
buttons and listview widgets...

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070930/7a0be9b9/attachment.sig>


More information about the kde-core-devel mailing list