mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Only render tabs if layout is needed.
This commit is contained in:
@@ -86,15 +86,12 @@ internal class TabRowView : View
|
||||
{
|
||||
_host.SwitchTabBy (scrollIndicatorHit);
|
||||
|
||||
SetNeedsLayout ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (hit is { })
|
||||
{
|
||||
_host.SelectedTab = hit;
|
||||
SetNeedsLayout ();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -119,11 +116,14 @@ internal class TabRowView : View
|
||||
/// <inheritdoc />
|
||||
protected override void OnSubviewLayout (LayoutEventArgs args)
|
||||
{
|
||||
_host._tabLocations = _host.CalculateViewport (Viewport).ToArray ();
|
||||
if (NeedsLayout)
|
||||
{
|
||||
_host._tabLocations = _host.CalculateViewport (Viewport).ToArray ();
|
||||
|
||||
RenderTabLine ();
|
||||
RenderTabLine ();
|
||||
|
||||
RenderUnderline ();
|
||||
RenderUnderline ();
|
||||
}
|
||||
|
||||
base.OnSubviewLayout (args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user