summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2020-02-27 19:16:27 -0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-03-02 07:19:44 +0100
commit201a7652092c6a7796a59e6ddee144e4f0c9ece9 (patch)
tree81c17f3335ec8bc85d57d2f2c2623882b1e79cdf
parenta741e86aaf9cc148dca20c2337a42e68270e669f (diff)
Stop Navigator content view flashing
Redraw flashing occurs in the content tree when outlines are moved during promote/demote chapter/level and when switching content navigation view mode. Also, the focus rectangle is briefly shown. This patch uses the m_bIsInPromoteDemote flag, that indicates when outline levels are in the process of being moved, to not redraw the content tree until after the moved outlines are reselected. To stop focus rectangle flashing a check for tree emptiness is used in the Paint function. Change-Id: I252c5a0032157c0a8287c748071d180675b3a70d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89659 Tested-by: Jenkins Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/uibase/utlui/content.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index d55c38febdf9..f8b8fb7bf425 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1773,8 +1773,8 @@ void SwContentTree::Display( bool bActive )
nEntryRelPos = GetModel()->GetAbsPos(pOldSelEntry) - GetModel()->GetAbsPos(pParentEntry);
}
}
- Clear();
SetUpdateMode( false );
+ SvTreeListBox::Clear();
if (!bActive)
m_eState = State::HIDDEN;
else if (State::HIDDEN == m_eState)
@@ -1912,7 +1912,6 @@ void SwContentTree::Display( bool bActive )
SetCurEntry(pParent);
}
}
- SetUpdateMode( true );
ScrollBar* pVScroll = GetVScroll();
if(GetEntryCount() == nOldEntryCount &&
nOldScrollPos && pVScroll && pVScroll->IsVisible()
@@ -1921,6 +1920,8 @@ void SwContentTree::Display( bool bActive )
sal_Int32 nDelta = pVScroll->GetThumbPos() - nOldScrollPos;
ScrollOutputArea( static_cast<short>(nDelta) );
}
+ if (!m_bIsInPromoteDemote)
+ SetUpdateMode( true );
}
void SwContentTree::Clear()
@@ -2720,6 +2721,8 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren)
}
SvTreeListBox::Invalidate();
}
+ // SetUpdateMode is set false in the Display function
+ SetUpdateMode(true);
}
}
@@ -2731,6 +2734,10 @@ void SwContentTree::ShowTree()
void SwContentTree::Paint( vcl::RenderContext& rRenderContext,
const tools::Rectangle& rRect )
{
+ // prevent focus rect from flashing when tree is cleared
+ // SvTreeListBox::Paint shows focus rectangle when tree is empty
+ if (!GetEntryCount())
+ return;
// Start the update timer on the first paint; avoids
// flicker on the first reveal.
m_aUpdTimer.Start();