Only render tabs if layout is needed.

This commit is contained in:
BDisp
2024-11-20 12:44:36 +00:00
parent 63a755d692
commit 6cb8478b6e
2 changed files with 11 additions and 6 deletions

View File

@@ -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);
}