From: Giannis Adamopoulos Date: Sun, 5 Mar 2017 09:09:30 +0000 (+0000) Subject: [COMCTL32] Ha^^Fix the size of the start button for lautus so as it gets the same... X-Git-Tag: ReactOS-0.4.4-CLT2017~19 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=2e5058f3bf797572dfd7297c1f0a8797cd9bf5d6 [COMCTL32] Ha^^Fix the size of the start button for lautus so as it gets the same size with our shell in ros and windows. svn path=/trunk/; revision=74072 --- diff --git a/reactos/dll/win32/comctl32/button.c b/reactos/dll/win32/comctl32/button.c index 3e2c0b6c7f9..31f402390d6 100644 --- a/reactos/dll/win32/comctl32/button.c +++ b/reactos/dll/win32/comctl32/button.c @@ -316,6 +316,7 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) HFONT hFont = 0, hPrevFont = 0; SIZE TextSize, ImageSize, ButtonSize; BOOL ret = FALSE; + LOGFONTW logfont; pdata = _GetButtonData(hwnd); text = get_button_text( hwnd ); @@ -326,7 +327,6 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) /* FIXME : Should use GetThemeTextExtent but unfortunately uses DrawTextW which is broken */ if (theme) { - LOGFONTW logfont; HRESULT hr = GetThemeFont(theme, hdc, BP_PUSHBUTTON, PBS_NORMAL, TMT_FONT, &logfont); if(SUCCEEDED(hr)) { @@ -343,6 +343,12 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) GetTextExtentPoint32W(hdc, text, wcslen(text), &TextSize); + if (logfont.lfHeight == -1 && logfont.lfWidth == 0 && wcscmp(logfont.lfFaceName, L"Arial") == 0) + { + TextSize.cx = 5; + TextSize.cy = 4; + } + if (hPrevFont) SelectObject( hdc, hPrevFont ); @@ -368,8 +374,8 @@ BOOL BUTTON_GetIdealSize(HTHEME theme, HWND hwnd, SIZE* psize) GetThemeBackgroundExtent(theme, hdc, BP_PUSHBUTTON, PBS_NORMAL, &rcContents, &rcButtonExtent); ERR("rcContents: %d, %d, %d, %d\n", rcContents.left, rcContents.top, rcContents.right, rcContents.bottom); ERR("rcButtonExtent: %d, %d, %d, %d\n", rcButtonExtent.left, rcButtonExtent.top, rcButtonExtent.right, rcButtonExtent.bottom); - ButtonSize.cx = abs(rcButtonExtent.right - rcButtonExtent.left) + 1; - ButtonSize.cy = abs(rcButtonExtent.bottom - rcButtonExtent.top) - 1; + ButtonSize.cx = rcButtonExtent.right - rcButtonExtent.left; + ButtonSize.cy = rcButtonExtent.bottom - rcButtonExtent.top; } else {