diff --git a/Src/Common/SimpleRootSite/SimpleRootSite.cs b/Src/Common/SimpleRootSite/SimpleRootSite.cs index 969f7f60f6..a88bb8dec5 100644 --- a/Src/Common/SimpleRootSite/SimpleRootSite.cs +++ b/Src/Common/SimpleRootSite/SimpleRootSite.cs @@ -1626,6 +1626,14 @@ public bool IsHScrollVisible get { return WantHScroll && AutoScrollMinSize.Width > Width; } } + /// + /// We want to allow clients to tell whether we are showing the vertical scroll bar. + /// + public bool IsVScrollVisible + { + get { return VScroll; } + } + /// ----------------------------------------------------------------------------------- /// /// Root site slaves sometimes need to suppress the effects of OnSizeChanged. diff --git a/Src/LexText/Interlinear/RawTextPane.cs b/Src/LexText/Interlinear/RawTextPane.cs index da6c3814fb..6149f00abe 100644 --- a/Src/LexText/Interlinear/RawTextPane.cs +++ b/Src/LexText/Interlinear/RawTextPane.cs @@ -43,6 +43,16 @@ public class RawTextPane : RootSite, IInterlinearTabControl, IHandleBookmark private string m_currentTool = ""; + public bool PreviousShowVScroll; + + private void RefreshIfNecessary(object sender, LayoutEventArgs e) + { + bool showVScroll = ((SimpleRootSite)m_rootb?.Site)?.IsVScrollVisible ?? false; + Layout -= RefreshIfNecessary; + if (showVScroll != PreviousShowVScroll) + RootBox?.Reconstruct(); + } + public string CurrentTool { get { return m_currentTool; } @@ -308,6 +318,12 @@ public override void OnPropertyChanged(string name) wsBefore = SelectionHelper.GetWsOfEntireSelection(m_rootb.Selection); } + if (name == "ActiveClerkSelectedObject") + { + Layout += RefreshIfNecessary; + PreviousShowVScroll = ((SimpleRootSite)m_rootb?.Site)?.IsVScrollVisible ?? false; + } + base.OnPropertyChanged(name); bool newVal; // used in two cases below switch (name)