Initial size and aspect ratio
Thomas Olsen
tanghus at gmail.com
Sat Oct 3 01:21:32 CEST 2009
On 3/10-2009 00:34 "Aaron J. Seigo" <aseigo at kde.org> wrote:
> On October 2, 2009, Thomas Olsen wrote:
> > On 2/10-2009 20:13 "Aaron J. Seigo" <aseigo at kde.org> wrote:
> > > On October 2, 2009, Thomas Olsen wrote:
> > > > - After having created the UI and layout in init() I need to resize
> > > > the Plasmoid the a reasonable size as it is too small without
> > > > specifying it [1]. I don't want to use a fixed pixel size as this can
> > > > be wrong for different themes, fonts etc. I tried to resize it based
> > > > on the max/minimum width/height of the main layout but that caused
> > > > plasma-desktop to eat all memory and eventually crash so I guess
> > > > thats the wrong way to do it ;-) What is the best practice for
> > > > setting the initial size?
> > >
> > > does the widget use a top level layout? you should be able to just set
> > > a default reasonable size in the ctor and then the layout can expand
> > > the widget if needed.
> >
> > Yes I have a toplevel layout
>
> the layout should be adjusting the size of the widgets it contains as
> needed or making sure the Applet item itself is large enough if the
> minimum size is run into. something is going wrong with the widget
> layout....
I've always had a love/hate affair with the Qt layout so I guess I'll have too
look into my layout design again. I might be wrong (English is not my native
language as you can see) but from what you're writing I understand that it
shouldn't be necessary to set the size explicitly if the layout is correct?
> > and I now I have set a default size both in
> > init()
>
> it should not go into init() as that will override the user's settings
> between sessions.
>
Aha. That makes sense.
--
Best Regards / Med venlig hilsen
Thomas Olsen
More information about the Plasma-devel
mailing list