Fixed behaviour of dropdown buttons. When a dropdown button is
clicked, it does not change into pressed state.
This commit is contained in:
parent
651332ee84
commit
66eedb5ae6
|
@ -3787,20 +3787,15 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
if (!(btnPtr->fsState & TBSTATE_ENABLED))
|
||||
return 0;
|
||||
|
||||
SetCapture (hwnd);
|
||||
infoPtr->bCaptured = TRUE;
|
||||
infoPtr->nButtonDown = nHit;
|
||||
infoPtr->nOldHit = nHit;
|
||||
|
||||
btnPtr->fsState |= TBSTATE_PRESSED;
|
||||
btnPtr->bHot = FALSE;
|
||||
|
||||
CopyRect(&arrowRect, &btnPtr->rect);
|
||||
arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH);
|
||||
|
||||
/* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */
|
||||
if ((btnPtr->fsStyle & TBSTYLE_DROPDOWN) &&
|
||||
!(TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && !PtInRect(&arrowRect, pt)))
|
||||
((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) ||
|
||||
(!TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle))))
|
||||
{
|
||||
NMTOOLBARA nmtb;
|
||||
/*
|
||||
|
@ -3819,8 +3814,17 @@ TOOLBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
(WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb);
|
||||
}
|
||||
else
|
||||
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr,
|
||||
btnPtr));
|
||||
{
|
||||
SetCapture (hwnd);
|
||||
infoPtr->bCaptured = TRUE;
|
||||
infoPtr->nButtonDown = nHit;
|
||||
|
||||
btnPtr->fsState |= TBSTATE_PRESSED;
|
||||
btnPtr->bHot = FALSE;
|
||||
|
||||
InvalidateRect(hwnd, &btnPtr->rect,
|
||||
TOOLBAR_HasText(infoPtr, btnPtr));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue