comctl32: toolbar: Use nHotItem not nOldHit for the hot item in MouseLeave.
This commit is contained in:
parent
d929cec671
commit
010f31f413
@ -5973,14 +5973,15 @@ static LRESULT
|
|||||||
TOOLBAR_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
TOOLBAR_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||||
TBUTTON_INFO *hotBtnPtr;
|
|
||||||
|
|
||||||
hotBtnPtr = &infoPtr->buttons[infoPtr->nOldHit];
|
|
||||||
|
|
||||||
/* don't remove hot effects when in anchor highlighting mode or when a
|
/* don't remove hot effects when in anchor highlighting mode or when a
|
||||||
* drop-down button is pressed */
|
* drop-down button is pressed */
|
||||||
if (!infoPtr->bAnchor && (infoPtr->nOldHit < 0 || !hotBtnPtr->bDropDownPressed))
|
if (infoPtr->nHotItem >= 0 && !infoPtr->bAnchor)
|
||||||
TOOLBAR_SetHotItemEx(infoPtr, TOOLBAR_NOWHERE, HICF_MOUSE);
|
{
|
||||||
|
TBUTTON_INFO *hotBtnPtr = &infoPtr->buttons[infoPtr->nHotItem];
|
||||||
|
if (!hotBtnPtr->bDropDownPressed)
|
||||||
|
TOOLBAR_SetHotItemEx(infoPtr, TOOLBAR_NOWHERE, HICF_MOUSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (infoPtr->nOldHit < 0)
|
if (infoPtr->nOldHit < 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -5996,7 +5997,7 @@ TOOLBAR_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
btnPtr->fsState &= ~TBSTATE_PRESSED;
|
||||||
|
|
||||||
rc1 = hotBtnPtr->rect;
|
rc1 = btnPtr->rect;
|
||||||
InflateRect (&rc1, 1, 1);
|
InflateRect (&rc1, 1, 1);
|
||||||
InvalidateRect (hwnd, &rc1, TRUE);
|
InvalidateRect (hwnd, &rc1, TRUE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user