Implemented new control preferredSize() on Mac OS X. Now that Stack works everywhere, I can resolve TODOs.
This commit is contained in:
parent
89643f70f7
commit
1bb187d55b
|
@ -25,12 +25,19 @@ static void singleSetParent(uiControl *c, uintptr_t parent)
|
|||
[parentView addSubview:S(c)->immediate];
|
||||
}
|
||||
|
||||
// also good for NSBox and NSProgressIndicator
|
||||
static uiSize singlePreferredSize(uiControl *c, uiSizing *d)
|
||||
{
|
||||
uiSize size;
|
||||
NSControl *control;
|
||||
NSRect r;
|
||||
|
||||
// TODO
|
||||
size.width = size.height = 0;
|
||||
control = (NSControl *) (S(c)->view);
|
||||
[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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue