[COMCTL32] Ha^^Fix the size of the start button for lautus so as it gets the same...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 5 Mar 2017 09:09:30 +0000 (09:09 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 5 Mar 2017 09:09:30 +0000 (09:09 +0000)
svn path=/trunk/; revision=74072

reactos/dll/win32/comctl32/button.c

index 3e2c0b6..31f4023 100644 (file)
@@ -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;
     HFONT hFont = 0, hPrevFont = 0;
     SIZE TextSize, ImageSize, ButtonSize;
     BOOL ret = FALSE;
+    LOGFONTW logfont;
 
     pdata = _GetButtonData(hwnd);
     text = get_button_text( hwnd );
 
     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)
     {
     /* 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))
         {
         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);
 
 
     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 );
 
     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);
         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
     {
     }
     else
     {