From c1ab903f22d267abd6186ae4f5e1c856027bae31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lauri=20Kentt=C3=A4?= Date: Mon, 30 May 2016 20:42:53 +0300 Subject: [PATCH] winefile: Fix horizontal scrolling. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lauri Kenttä Signed-off-by: Alexandre Julliard --- programs/winefile/winefile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index f8247a71667..5709c8ea421 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -118,6 +118,7 @@ typedef struct { #define COLUMNS 10 int widths[COLUMNS]; + int widths_shown[COLUMNS]; int positions[COLUMNS+1]; BOOL treePane; @@ -2355,6 +2356,7 @@ static HWND create_header(HWND parent, Pane* pane, UINT id) hdi.pszText = g_pos_names[idx]; hdi.fmt = HDF_STRING | g_pos_align[idx]; hdi.cxy = pane->widths[idx]; + pane->widths_shown[idx] = hdi.cxy; SendMessageW(hwnd, HDM_INSERTITEMW, idx, (LPARAM)&hdi); } @@ -3168,17 +3170,20 @@ static void set_header(Pane* pane) for(; (i < COLUMNS) && (x+pane->widths[i] < scroll_pos); i++) { x += pane->widths[i]; + pane->widths_shown[i] = item.cxy; SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item); } if (i < COLUMNS) { x += pane->widths[i]; item.cxy = x - scroll_pos; + pane->widths_shown[i] = item.cxy; SendMessageW(pane->hwndHeader, HDM_SETITEMW, i++, (LPARAM)&item); for(; i < COLUMNS; i++) { item.cxy = pane->widths[i]; x += pane->widths[i]; + pane->widths_shown[i] = item.cxy; SendMessageW(pane->hwndHeader, HDM_SETITEMW, i, (LPARAM)&item); } } @@ -3190,13 +3195,14 @@ static LRESULT pane_notify(Pane* pane, NMHDR* pnmh) case HDN_ITEMCHANGEDW: { LPNMHEADERW phdn = (LPNMHEADERW)pnmh; int idx = phdn->iItem; - int dx = phdn->pitem->cxy - pane->widths[idx]; + int dx = phdn->pitem->cxy - pane->widths_shown[idx]; int i; RECT clnt; GetClientRect(pane->hwnd, &clnt); pane->widths[idx] += dx; + pane->widths_shown[idx] += dx; for(i=idx; ++i<=COLUMNS; ) pane->positions[i] += dx; -- 2.11.4.GIT