WCHAR *text;
HFONT hFont = 0, hPrevFont = 0;
SIZE TextSize, ImageSize, ButtonSize;
+ BOOL ret = FALSE;
pdata = _GetButtonData(hwnd);
text = get_button_text( hwnd );
hdc = GetDC(hwnd);
if (!pdata || !text || !hdc || !text[0])
- {
- psize->cx = 100;
- psize->cy = 100;
goto cleanup;
- }
/* FIXME : Should use GetThemeTextExtent but unfortunately uses DrawTextW which is broken */
if (theme)
}
*psize = ButtonSize;
+ ret = TRUE;
cleanup:
if (hFont)
if (hdc)
ReleaseDC(hwnd, hdc);
- return TRUE;
+ return ret;
}
#endif
case BCM_GETIDEALSIZE:
{
HTHEME theme = GetWindowTheme(hWnd);
+ BOOL ret = FALSE;
+ SIZE* pSize = (SIZE*)lParam;
- if (btn_type != BS_PUSHBUTTON && btn_type != BS_DEFPUSHBUTTON)
+ if (btn_type == BS_PUSHBUTTON ||
+ btn_type == BS_DEFPUSHBUTTON ||
+ btn_type == BS_USERBUTTON)
+ {
+ ret = BUTTON_GetIdealSize(theme, hWnd, pSize);
+ }
+
+ if (!ret)
{
- SIZE* pSize = (SIZE*)lParam;
GetClientRect(hWnd, &rect);
pSize->cx = rect.right;
pSize->cy = rect.bottom;
- return TRUE;
}
- return BUTTON_GetIdealSize(theme, hWnd, (SIZE*)lParam);
+ return TRUE;
}
}