comctl32/status: Do not use theme metrics to compute height.
Fix status test failures when theming is on. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f51a12f969
commit
8f6a4438b4
|
@ -102,7 +102,6 @@ static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
|
|||
static UINT
|
||||
STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
|
||||
{
|
||||
HTHEME theme;
|
||||
UINT height;
|
||||
TEXTMETRICW tm;
|
||||
int margin;
|
||||
|
@ -111,21 +110,6 @@ STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
|
|||
margin = (tm.tmInternalLeading ? tm.tmInternalLeading : 2);
|
||||
height = max(tm.tmHeight + margin + 2*GetSystemMetrics(SM_CYBORDER), infoPtr->minHeight) + infoPtr->verticalBorder;
|
||||
|
||||
if ((theme = GetWindowTheme(infoPtr->Self)))
|
||||
{
|
||||
/* Determine bar height from theme such that the content area is
|
||||
* textHeight pixels large */
|
||||
HDC hdc = GetDC(infoPtr->Self);
|
||||
RECT r;
|
||||
|
||||
SetRect(&r, 0, 0, 0, max(infoPtr->minHeight, tm.tmHeight));
|
||||
if (SUCCEEDED(GetThemeBackgroundExtent(theme, hdc, SP_PANE, 0, &r, &r)))
|
||||
{
|
||||
height = r.bottom - r.top;
|
||||
}
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
}
|
||||
|
||||
TRACE(" textHeight=%d+%d, final height=%d\n", tm.tmHeight, tm.tmInternalLeading, height);
|
||||
return height;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue