From 579335fcd5bfdcf3c54e8d06f181b00bde3efa58 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 23 Apr 2020 19:58:33 +0300 Subject: =?UTF-8?q?fixes=20#2331=20(NewStory:=20=D0=BD=D0=B5=20=D0=B4?= =?UTF-8?q?=D0=BE=20=D0=BA=D0=BE=D0=BD=D1=86=D0=B0=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D1=8F=D0=B5=D1=82=20=D0=BF=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D1=81=D1=82=D0=B2=D0=BE=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B2=D0=B0=D1=82=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_control.cpp | 8 ++++++-- plugins/NewStory/src/history_control.h | 1 + plugins/NewStory/src/history_log.cpp | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins/NewStory') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index bfebfb4600..6d7f6a339f 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -153,15 +153,15 @@ static void FixScrollPosition(HWND hwnd, NewstoryListData *data) data->cachedMaxTopPixel = (windowHeight < tmp) ? windowHeight - tmp : 0; } - if (data->scrollTopItem < 0) { + if (data->scrollTopItem < 0) data->scrollTopItem = 0; - } if ((data->scrollTopItem > data->cachedMaxTopItem) || ((data->scrollTopItem == data->cachedMaxTopItem) && (data->scrollTopPixel < data->cachedMaxTopPixel))) { data->scrollTopItem = data->cachedMaxTopItem; data->scrollTopPixel = data->cachedMaxTopPixel; } + RecalcScrollBar(hwnd, data); } @@ -613,6 +613,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM } return TRUE; + case NSM_SEEKEND: + SendMessage(hwnd, NSM_SETCARET, data->items.getCount() - 1, 1); + break; + case NSM_COPY: { CMStringW res; diff --git a/plugins/NewStory/src/history_control.h b/plugins/NewStory/src/history_control.h index 934da14054..80a95047ac 100644 --- a/plugins/NewStory/src/history_control.h +++ b/plugins/NewStory/src/history_control.h @@ -71,6 +71,7 @@ enum NSM_GETCOUNT, // + NSM_SEEKEND, NSM_SEEKTIME, NSM_LAST diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp index 0fb7b1134b..1bcd86ab24 100644 --- a/plugins/NewStory/src/history_log.cpp +++ b/plugins/NewStory/src/history_log.cpp @@ -73,6 +73,7 @@ public: void ScrollToBottom() override { + ::SendMessage(m_hwnd, NSM_SEEKEND, 0, 0); } }; -- cgit v1.2.3