From 3022e515e505367a7b323ee717c52f2406beff79 Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Wed, 25 Mar 2020 11:52:08 +0200 Subject: [PATCH] button: add uiButtonPreferredSize macos implementation --- darwin/button.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/darwin/button.m b/darwin/button.m index 0efd5725..1813e1f7 100644 --- a/darwin/button.m +++ b/darwin/button.m @@ -116,6 +116,13 @@ void uiButtonSetMinSize(uiButton *b, int width, int 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) { b->onClicked = f;