From: Brendan McGrath bmcgrath@codeweavers.com
Windows sets the default width to LOGPIXELSX regardless of the style.
It will also always return the previous cx value provided. --- dlls/comctl32/tab.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index d2310ea1567..e1176963377 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -2669,19 +2669,20 @@ TAB_SetItemSize (TAB_INFO *infoPtr, INT cx, INT cy) lResult = MAKELONG(infoPtr->tabWidth, infoPtr->tabHeight);
/* UNDOCUMENTED: If requested Width or Height is 0 this means that program wants to use auto size. */ - if (infoPtr->dwStyle & TCS_FIXEDWIDTH && (infoPtr->tabWidth != cx)) + if (infoPtr->tabWidth != cx) { infoPtr->tabWidth = cx; bNeedPaint = TRUE; }
- if (infoPtr->tabHeight != cy) + if (infoPtr->tabHeight != cy && cy != 0) { - if ((infoPtr->fHeightSet = (cy != 0))) - infoPtr->tabHeight = cy; - + infoPtr->tabHeight = cy; bNeedPaint = TRUE; } + + infoPtr->fHeightSet = (cy != 0); + TRACE("was h=%d,w=%d, now h=%d,w=%d\n", HIWORD(lResult), LOWORD(lResult), infoPtr->tabHeight, infoPtr->tabWidth); @@ -3067,8 +3068,7 @@ static LRESULT TAB_Create (HWND hwnd, LPARAM lParam) infoPtr->uVItemPadding;
/* Initialize the width of a tab. */ - if (infoPtr->dwStyle & TCS_FIXEDWIDTH) - infoPtr->tabWidth = GetDeviceCaps(hdc, LOGPIXELSX); + infoPtr->tabWidth = GetDeviceCaps(hdc, LOGPIXELSX);
infoPtr->tabMinWidth = -1;