button: add uiButtonPreferredSize macos implementation
This commit is contained in:
parent
580b04b41f
commit
3022e515e5
|
@ -116,6 +116,13 @@ void uiButtonSetMinSize(uiButton *b, int width, int height)
|
||||||
libui_btn.minHeight = height;
|
libui_btn.minHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uiButtonPreferredSize(uiButton *b, int *width, int *height)
|
||||||
|
{
|
||||||
|
NSSize s = b->button.intrinsicContentSize;
|
||||||
|
*width = s.width;
|
||||||
|
*height = s.height;
|
||||||
|
}
|
||||||
|
|
||||||
void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data)
|
void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data)
|
||||||
{
|
{
|
||||||
b->onClicked = f;
|
b->onClicked = f;
|
||||||
|
|
Loading…
Reference in New Issue