[haiku-commits] Re: haiku: hrev48491 - src/preferences/filetypes

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 15 Dec 2014 12:55:57 +0100

On Mon, Dec 15, 2014 at 12:25:56PM +0100, Stephan Aßmus wrote:
> Hi,
> 
> Am 15.12.2014 11:52, schrieb Adrien Destugues:
> >While we are at it, and since I have a similar problem in the
> >DataTranslations preferences: what would be the correct way to set a
> >minimal size to a view, so that it still takes the minimal size of the
> >children into account? Is the only way to override the MinSize method
> >then?
> 
> You mean something different from view->SetExplicitMaxSize(view->MinSize())?
> 
> You can call MinSize() or one of the others as soon as all children are
> attached to a view. Or lets rephrase that - as soon as the view has all the
> information for computing correct sizes. You can do anything with those
> values, also computing explicit sizes as you see fit.

In the case of DataTranslations, the problem is that the window size
changes as you swithc between different translators and they are
added/removed to the view. I tried to set an arbitrary minimal size
there so:
- The window has a reasonable size and fits the screen
- Most translators can fit their settings view in the allocated space
- Should a translator need more space, the window could still be made
  bigger

But setting the explicit min size of the window doesn't allow the 3rd
item, as the size of the child view is ignored when an explicit min size
is set.

-- 
Adrien.

Other related posts: