button: add uiButtonPreferredSize
This commit is contained in:
parent
be5288bc73
commit
43cf92a277
1
ui.h
1
ui.h
|
@ -139,6 +139,7 @@ _UI_EXTERN void uiButtonSetText(uiButton *b, const char *text);
|
|||
_UI_EXTERN void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *b, void *data), void *data);
|
||||
_UI_EXTERN uiButton *uiNewButton(const char *text);
|
||||
_UI_EXTERN void uiButtonSetMinSize(uiButton *b, int width, int height);
|
||||
_UI_EXTERN void uiButtonPreferredSize(uiButton *b, int *width, int *height);
|
||||
|
||||
typedef struct uiBox uiBox;
|
||||
#define uiBox(this) ((uiBox *) (this))
|
||||
|
|
|
@ -89,6 +89,11 @@ void uiButtonSetMinSize(uiButton *b, int width, int height)
|
|||
uiWindowsControlMinimumSizeChanged(uiWindowsControl(b));
|
||||
}
|
||||
|
||||
void uiButtonPreferredSize(uiButton *b, int *width, int *height)
|
||||
{
|
||||
uiButtonMinimumSize(uiWindowsControl(b), width, height);
|
||||
}
|
||||
|
||||
void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data)
|
||||
{
|
||||
b->onClicked = f;
|
||||
|
|
Loading…
Reference in New Issue