mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[LISTVIEW] Add basic support for LVS_EX_SNAPTOGRID
This commit is contained in:
parent
fbee8fa99e
commit
733a32dade
1 changed files with 15 additions and 0 deletions
|
@ -8749,6 +8749,13 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD mas
|
|||
LISTVIEW_UpdateScroll(infoPtr);
|
||||
}
|
||||
|
||||
#ifdef __REACTOS__
|
||||
if ((infoPtr->dwLvExStyle & LVS_EX_SNAPTOGRID) > (old_ex_style & LVS_EX_SNAPTOGRID))
|
||||
{
|
||||
LISTVIEW_Arrange(infoPtr, LVA_SNAPTOGRID);
|
||||
}
|
||||
#endif
|
||||
|
||||
LISTVIEW_InvalidateList(infoPtr);
|
||||
return old_ex_style;
|
||||
}
|
||||
|
@ -9082,6 +9089,14 @@ static BOOL LISTVIEW_SetItemPosition(LISTVIEW_INFO *infoPtr, INT nItem, const PO
|
|||
Pt.x -= Origin.x;
|
||||
Pt.y -= Origin.y;
|
||||
|
||||
#ifdef __REACTOS__
|
||||
if (infoPtr->dwLvExStyle & LVS_EX_SNAPTOGRID)
|
||||
{
|
||||
Pt.x = max(0, Pt.x + (infoPtr->nItemWidth >> 1) - (Pt.x + (infoPtr->nItemWidth >> 1)) % infoPtr->nItemWidth);
|
||||
Pt.y = max(0, Pt.y + (infoPtr->nItemHeight >> 1) - (Pt.y + (infoPtr->nItemHeight >> 1)) % infoPtr->nItemHeight);
|
||||
}
|
||||
#endif
|
||||
|
||||
return LISTVIEW_MoveIconTo(infoPtr, nItem, &Pt, FALSE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue