comctl32/treeview: Fix hot-tracking with TVS_FULLROWSELECT.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2728909e6c
commit
0220d47c02
|
@ -353,6 +353,20 @@ TREEVIEW_IsChildOf(const TREEVIEW_ITEM *parent, const TREEVIEW_ITEM *child)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
TREEVIEW_IsFullRowSelect(const TREEVIEW_INFO *infoPtr)
|
||||||
|
{
|
||||||
|
return !(infoPtr->dwStyle & TVS_HASLINES) && (infoPtr->dwStyle & TVS_FULLROWSELECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
TREEVIEW_IsItemHit(const TREEVIEW_INFO *infoPtr, const TVHITTESTINFO *ht)
|
||||||
|
{
|
||||||
|
if (TREEVIEW_IsFullRowSelect(infoPtr))
|
||||||
|
return ht->flags & (TVHT_ONITEMINDENT | TVHT_ONITEMBUTTON | TVHT_ONITEM | TVHT_ONITEMRIGHT);
|
||||||
|
else
|
||||||
|
return ht->flags & TVHT_ONITEM;
|
||||||
|
}
|
||||||
|
|
||||||
/* Tree Traversal *******************************************************/
|
/* Tree Traversal *******************************************************/
|
||||||
|
|
||||||
|
@ -5334,6 +5348,7 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
|
||||||
TRACKMOUSEEVENT trackinfo;
|
TRACKMOUSEEVENT trackinfo;
|
||||||
TREEVIEW_ITEM * item;
|
TREEVIEW_ITEM * item;
|
||||||
TVHITTESTINFO ht;
|
TVHITTESTINFO ht;
|
||||||
|
BOOL item_hit;
|
||||||
|
|
||||||
if (!(infoPtr->dwStyle & TVS_TRACKSELECT)) return 0;
|
if (!(infoPtr->dwStyle & TVS_TRACKSELECT)) return 0;
|
||||||
|
|
||||||
|
@ -5362,12 +5377,13 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
|
||||||
ht.pt.y = (short)HIWORD(lParam);
|
ht.pt.y = (short)HIWORD(lParam);
|
||||||
|
|
||||||
item = TREEVIEW_HitTest(infoPtr, &ht);
|
item = TREEVIEW_HitTest(infoPtr, &ht);
|
||||||
if ((item != infoPtr->hotItem) || !(ht.flags & TVHT_ONITEM))
|
item_hit = TREEVIEW_IsItemHit(infoPtr, &ht);
|
||||||
|
if ((item != infoPtr->hotItem) || !item_hit)
|
||||||
{
|
{
|
||||||
/* redraw old hot item */
|
/* redraw old hot item */
|
||||||
TREEVIEW_InvalidateItem(infoPtr, infoPtr->hotItem);
|
TREEVIEW_InvalidateItem(infoPtr, infoPtr->hotItem);
|
||||||
infoPtr->hotItem = NULL;
|
infoPtr->hotItem = NULL;
|
||||||
if (item && (ht.flags & TVHT_ONITEM))
|
if (item && item_hit)
|
||||||
{
|
{
|
||||||
infoPtr->hotItem = item;
|
infoPtr->hotItem = item;
|
||||||
/* redraw new hot item */
|
/* redraw new hot item */
|
||||||
|
@ -5532,7 +5548,7 @@ TREEVIEW_SetCursor(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
if (TREEVIEW_SendRealNotify(infoPtr, NM_SETCURSOR, &nmmouse.hdr))
|
if (TREEVIEW_SendRealNotify(infoPtr, NM_SETCURSOR, &nmmouse.hdr))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (item && (infoPtr->dwStyle & TVS_TRACKSELECT) && (ht.flags & TVHT_ONITEM))
|
if (item && (infoPtr->dwStyle & TVS_TRACKSELECT) && TREEVIEW_IsItemHit(infoPtr, &ht))
|
||||||
{
|
{
|
||||||
SetCursor(infoPtr->hcurHand);
|
SetCursor(infoPtr->hcurHand);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue