--- a/ui/win32/button.c Sun Oct 12 09:17:37 2025 +0200 +++ b/ui/win32/button.c Sun Oct 12 12:01:03 2025 +0200 @@ -32,6 +32,8 @@ #include <stdio.h> #include <stdlib.h> +#include <commctrl.h> + static W32WidgetClass button_widget_class = { .eventproc = ui_button_eventproc, .enable = w32_widget_default_enable, @@ -72,6 +74,11 @@ W32Size size; size.width = 100; size.height = 30; + SIZE sz; + if (Button_GetIdealSize(widget->hwnd, &sz)) { + size.width = sz.cx; + size.height = sz.cy; + } return size; }