mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
user32: Use window height/width instead of client for combo resizing.
This commit is contained in:
parent
0515b44f2f
commit
ac0738471d
1 changed files with 12 additions and 8 deletions
|
@ -1507,7 +1507,7 @@ static void CBResetPos(
|
|||
/***********************************************************************
|
||||
* COMBO_Size
|
||||
*/
|
||||
static void COMBO_Size( LPHEADCOMBO lphc, LPARAM lParam )
|
||||
static void COMBO_Size( LPHEADCOMBO lphc )
|
||||
{
|
||||
/*
|
||||
* Those controls are always the same height. So we have to make sure
|
||||
|
@ -1515,8 +1515,12 @@ static void COMBO_Size( LPHEADCOMBO lphc, LPARAM lParam )
|
|||
*/
|
||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||
{
|
||||
int newComboHeight;
|
||||
int newComboHeight, curComboHeight, curComboWidth;
|
||||
RECT rc;
|
||||
|
||||
GetWindowRect(lphc->self, &rc);
|
||||
curComboHeight = rc.bottom - rc.top;
|
||||
curComboWidth = rc.right - rc.left;
|
||||
newComboHeight = CBGetTextAreaHeight(lphc->self, lphc) + 2*COMBO_YBORDERSIZE();
|
||||
|
||||
/*
|
||||
|
@ -1527,18 +1531,18 @@ static void COMBO_Size( LPHEADCOMBO lphc, LPARAM lParam )
|
|||
* the actual control, for example, to do the layout of a dialog that is
|
||||
* resized, the height of the dropdown is not changed.
|
||||
*/
|
||||
if( HIWORD(lParam) > newComboHeight )
|
||||
if( curComboHeight > newComboHeight )
|
||||
{
|
||||
TRACE("oldComboHeight=%d, newComboHeight=%d, oldDropBottom=%d, oldDropTop=%d\n",
|
||||
HIWORD(lParam), newComboHeight, lphc->droppedRect.bottom,
|
||||
curComboHeight, newComboHeight, lphc->droppedRect.bottom,
|
||||
lphc->droppedRect.top);
|
||||
lphc->droppedRect.bottom = lphc->droppedRect.top + HIWORD(lParam) - newComboHeight;
|
||||
lphc->droppedRect.bottom = lphc->droppedRect.top + curComboHeight - newComboHeight;
|
||||
}
|
||||
/*
|
||||
* Restore original height
|
||||
*/
|
||||
if( HIWORD(lParam) != newComboHeight )
|
||||
SetWindowPos(lphc->self, 0, 0, 0, LOWORD(lParam), newComboHeight,
|
||||
if( curComboHeight != newComboHeight )
|
||||
SetWindowPos(lphc->self, 0, 0, 0, curComboWidth, newComboHeight,
|
||||
SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOREDRAW);
|
||||
}
|
||||
|
||||
|
@ -1862,7 +1866,7 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
|
|||
}
|
||||
case WM_SIZE:
|
||||
if( lphc->hWndLBox &&
|
||||
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc, lParam );
|
||||
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
|
||||
return TRUE;
|
||||
case WM_SETFONT:
|
||||
COMBO_Font( lphc, (HFONT)wParam, (BOOL)lParam );
|
||||
|
|
Loading…
Reference in a new issue