Implemented new control preferredSize() on Mac OS X. Now that Stack works everywhere, I can resolve TODOs.
This commit is contained in:
parent
a6f175767e
commit
05a1cc535a
|
@ -25,12 +25,19 @@ static void singleSetParent(uiControl *c, uintptr_t parent)
|
||||||
[parentView addSubview:S(c)->immediate];
|
[parentView addSubview:S(c)->immediate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// also good for NSBox and NSProgressIndicator
|
||||||
static uiSize singlePreferredSize(uiControl *c, uiSizing *d)
|
static uiSize singlePreferredSize(uiControl *c, uiSizing *d)
|
||||||
{
|
{
|
||||||
uiSize size;
|
uiSize size;
|
||||||
|
NSControl *control;
|
||||||
|
NSRect r;
|
||||||
|
|
||||||
// TODO
|
control = (NSControl *) (S(c)->view);
|
||||||
size.width = size.height = 0;
|
[control sizeToFit];
|
||||||
|
// use alignmentRect here instead of frame because we'll be resizing based on that
|
||||||
|
r = [control alignmentRectForFrame:[control frame]];
|
||||||
|
size.width = (intmax_t) r.size.width;
|
||||||
|
size.height = (intmax_t) r.size.height;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue