summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-08-18 14:12:27 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-08-18 14:12:27 +0300
commitd92bc4c8184313d4963bce815b8c50c33684d07d (patch)
treeaed9ef2fee816d51e49e461ebf2933369001b0f6 /plugins
parent80edfc64c0934a2316182735a11d06053337ba44 (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')
-rw-r--r--plugins/NewStory/src/history_control.cpp8
-rw-r--r--plugins/NewStory/src/history_control.h2
2 files changed, 8 insertions, 2 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);
}
diff --git a/plugins/NewStory/src/history_control.h b/plugins/NewStory/src/history_control.h
index f557d9c694..5bafeaa727 100644
--- a/plugins/NewStory/src/history_control.h
+++ b/plugins/NewStory/src/history_control.h
@@ -61,7 +61,7 @@ struct NewstoryListData : public MZeroedObject
RECT rcLastPaint;
- bool bWasShift, bSortAscending, hasData;
+ bool bWasShift, bSortAscending, hasData, bWasAtBottom;
HWND hwnd;
HWND hwndEditBox;