Author: gadamopoulos Date: Sun Mar 5 09:09:30 2017 New Revision: 74072
URL: http://svn.reactos.org/svn/reactos?rev=74072&view=rev Log: [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.
Modified: trunk/reactos/dll/win32/comctl32/button.c
Modified: trunk/reactos/dll/win32/comctl32/button.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/button.c... ============================================================================== --- trunk/reactos/dll/win32/comctl32/button.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/button.c [iso-8859-1] Sun Mar 5 09:09:30 2017 @@ -316,6 +316,7 @@ 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 @@ /* 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)) { @@ -342,6 +342,12 @@ }
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 @@ 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 {