From 880a38410ca863c3cfb87d6d87df1d6918b3e3bb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Aug 2023 19:38:06 +0300 Subject: =?UTF-8?q?fixes=20#3613=20(NewStory:=20=D0=B2=D1=8B=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=BA=D0=B8=D1=85=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B1=D0=B5=D0=B7=20=D0=BA=D0=BB?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=B0=D1=82=D1=83=D1=80=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_control.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 329b333920..1b9e61c0af 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -621,7 +621,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VSCROLL); break; - // History list control messages + // History list control messages case NSM_ADDEVENTS: if (auto *p = (ADDEVENTS *)wParam) { data->items.addEvent(p->hContact, p->hFirstEVent, p->eventCount); @@ -967,6 +967,7 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return 0; } + data->selStart = idx; data->SetSelection(idx, idx); data->SetCaret(idx); } @@ -974,6 +975,13 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SetFocus(hwnd); return 0; + case WM_LBUTTONUP: + pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + idx = data->GetItemFromPixel(pt.y); + if (idx >= 0) + data->selStart = -1; + break; + case WM_LBUTTONDBLCLK: pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; idx = data->GetItemFromPixel(pt.y); @@ -1004,6 +1012,9 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (idx >= 0) { auto *pItem = data->LoadItem(idx); MTextSendMessage(hwnd, pItem->data, msg, wParam, lParam); + + if (data->selStart != -1) + data->SetSelection(data->selStart, idx); } break; -- cgit v1.2.3