Commit 64e5779c authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

comctl32: header: Make the column resizing smooth in full drag mode.

Make the column resizing smooth in full drag mode even for listview with lots of elements by redrawing only the resized column and calling UpdateWindow.
parent e48a0a3c
...@@ -1657,14 +1657,25 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1657,14 +1657,25 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (dwStyle & HDS_FULLDRAG) { if (dwStyle & HDS_FULLDRAG) {
if (!HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, NULL)) if (!HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, NULL))
{ {
nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset; HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem];
if (nWidth < 0) INT nOldWidth = lpItem->rect.right - lpItem->rect.left;
nWidth = 0; RECT rcClient;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; RECT rcScroll;
HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, NULL);
nWidth = pt.x - lpItem->rect.left + infoPtr->xTrackOffset;
if (nWidth < 0) nWidth = 0;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
HEADER_SetItemBounds(hwnd);
GetClientRect(hwnd, &rcClient);
rcScroll = rcClient;
rcScroll.left = lpItem->rect.left + nOldWidth;
ScrollWindowEx(hwnd, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0);
InvalidateRect(hwnd, &lpItem->rect, FALSE);
UpdateWindow(hwnd);
HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, NULL);
} }
HEADER_SetItemBounds (hwnd);
InvalidateRect(hwnd, NULL, FALSE);
} }
else { else {
hdc = GetDC (hwnd); hdc = GetDC (hwnd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment