diff options
Diffstat (limited to 'plugins/NewStory')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 8 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.h | 2 |
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; |