From 0bbaf7285e74ab4625354ad6a926625e0b1324fc Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 28 Jan 2014 04:37:29 -0800 Subject: [PATCH] =?UTF-8?q?MGR:=20scroll=20Event=20Log=20to=20bottom=20whe?= =?UTF-8?q?n=20switching=20from=20=E2=80=9CShow=20only=20this=20project?= =?UTF-8?q?=E2=80=9D=20to=20=E2=80=9CShow=20all=20messages=E2=80=9D=20or?= =?UTF-8?q?=20vice-versa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- clientgui/DlgEventLog.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index 2a0ed53204..b5f6c5da9a 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -55,6 +55,7 @@ static bool s_bIsFiltered = false; +static bool s_bFilteringChanged = false; static std::string s_strFilteredProjectName; /*! @@ -467,6 +468,7 @@ void CDlgEventLog::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { } } + s_bFilteringChanged = true; SetFilterButtonText(); // Force a complete update @@ -624,15 +626,22 @@ void CDlgEventLog::OnRefresh() { } } - if ((iRowCount > 1) && (m_iPreviousLastMsgSeqNum != pDoc->GetLastMsgSeqNum())) { - if (EnsureLastItemVisible()) { + if (iRowCount > 1) { + if (s_bFilteringChanged) { m_pList->EnsureVisible(iRowCount - 1); - } else if (topItem > 0) { - int n = topItem - m_iNumDeletedFilteredRows; - if (n < 0) n = 0; - Freeze(); // Avoid flicker if selected rows are visible - m_pList->EnsureVisible(n); - Thaw(); + s_bFilteringChanged = false; + } else { + if (m_iPreviousLastMsgSeqNum != pDoc->GetLastMsgSeqNum()) { + if (EnsureLastItemVisible()) { + m_pList->EnsureVisible(iRowCount - 1); + } else if (topItem > 0) { + int n = topItem - m_iNumDeletedFilteredRows; + if (n < 0) n = 0; + Freeze(); // Avoid flicker if selected rows are visible + m_pList->EnsureVisible(n); + Thaw(); + } + } } } @@ -903,6 +912,7 @@ void CDlgEventLog::OnColResize( wxListEvent& ) { } void CDlgEventLog::ResetMessageFiltering() { + s_bFilteringChanged = false; s_bIsFiltered = false; s_strFilteredProjectName.clear(); m_iFilteredIndexes.Clear();