diff options
author | George Hazan <george.hazan@gmail.com> | 2023-08-18 14:12:27 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-08-18 14:12:27 +0300 |
commit | d92bc4c8184313d4963bce815b8c50c33684d07d (patch) | |
tree | aed9ef2fee816d51e49e461ebf2933369001b0f6 /plugins/NewStory/src/history_control.cpp | |
parent | 80edfc64c0934a2316182735a11d06053337ba44 (diff) |
NewStory: if we manually scrolled log up, don't let it move back to the bottom on a new event
Diffstat (limited to 'plugins/NewStory/src/history_control.cpp')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index fc5adebd39..689ac81d71 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -84,7 +84,9 @@ void NewstoryListData::OnTimer(CTimer *pTimer) { pTimer->Stop(); - EnsureVisible(totalCount - 1); + if (bWasAtBottom) + EnsureVisible(totalCount - 1); + InvalidateRect(hwnd, 0, FALSE); } @@ -128,6 +130,9 @@ void NewstoryListData::AddSelection(int iFirst, int iLast) bool NewstoryListData::AtBottom(void) const { + if (cachedMaxDrawnItem == -1) + return true; + if (cachedMaxDrawnItem > totalCount) return true; @@ -475,6 +480,7 @@ void NewstoryListData::RecalcScrollBar() void NewstoryListData::ScheduleDraw() { + bWasAtBottom = AtBottom(); redrawTimer.Stop(); redrawTimer.Start(30); } |