Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LT-20849: Refresh Baseline on Text switch if VScroll changes #230

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Src/Common/SimpleRootSite/SimpleRootSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,14 @@ public bool IsHScrollVisible
get { return WantHScroll && AutoScrollMinSize.Width > Width; }
}

/// <summary>
/// We want to allow clients to tell whether we are showing the vertical scroll bar.
/// </summary>
public bool IsVScrollVisible
{
get { return VScroll; }
}

/// -----------------------------------------------------------------------------------
/// <summary>
/// Root site slaves sometimes need to suppress the effects of OnSizeChanged.
Expand Down
16 changes: 16 additions & 0 deletions Src/LexText/Interlinear/RawTextPane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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)
Expand Down
Loading