Rename to TabRow.

This commit is contained in:
BDisp
2024-11-25 13:35:21 +00:00
parent 1d91f1b315
commit aa2f3f8461
3 changed files with 11 additions and 11 deletions

View File

@@ -1,16 +1,16 @@
#nullable enable
namespace Terminal.Gui;
internal class TabRowView : View
internal class TabRow : View
{
private readonly TabView _host;
private readonly View _leftScrollIndicator;
private readonly View _rightScrollIndicator;
public TabRowView (TabView host)
public TabRow (TabView host)
{
_host = host;
Id = "tabRowView";
Id = "tabRow";
CanFocus = true;
TabStop = TabBehavior.TabGroup;

View File

@@ -16,7 +16,7 @@ public class TabView : View
private readonly List<Tab> _tabs = new ();
/// <summary>This sub view is the 2 or 3 line control that represents the actual tabs themselves.</summary>
private readonly TabRowView _tabsBar;
private readonly TabRow _tabsBar;
private Tab? _selectedTab;
@@ -28,7 +28,7 @@ public class TabView : View
{
CanFocus = true;
TabStop = TabBehavior.TabStop; // Because TabView has focusable subviews, it must be a TabGroup
_tabsBar = new TabRowView (this);
_tabsBar = new TabRow (this);
_containerView = new ();
ApplyStyleChanges ();

View File

@@ -101,7 +101,7 @@ public class TabViewTests (ITestOutputHelper output)
tv.Draw ();
View tabRow = tv.Subviews [0];
Assert.Equal ("TabRowView", tabRow.GetType ().Name);
Assert.Equal ("TabRow", tabRow.GetType ().Name);
TestHelpers.AssertDriverContentsAre (
@"
@@ -184,7 +184,7 @@ public class TabViewTests (ITestOutputHelper output)
tv.Draw ();
View tabRow = tv.Subviews [0];
Assert.Equal ("TabRowView", tabRow.GetType ().Name);
Assert.Equal ("TabRow", tabRow.GetType ().Name);
TestHelpers.AssertDriverContentsAre (
@"
@@ -272,7 +272,7 @@ public class TabViewTests (ITestOutputHelper output)
tv.Draw ();
View tabRow = tv.Subviews [0];
Assert.Equal ("TabRowView", tabRow.GetType ().Name);
Assert.Equal ("TabRow", tabRow.GetType ().Name);
TestHelpers.AssertDriverContentsAre (
@"
@@ -433,7 +433,7 @@ public class TabViewTests (ITestOutputHelper output)
Assert.Equal (btnSubView, top.MostFocused);
Assert.True (Application.RaiseKeyDownEvent (Key.CursorUp));
// TabRowView now has TabGroup which only F6 is allowed
// TabRow now has TabGroup which only F6 is allowed
Assert.NotEqual (tab2, top.MostFocused);
Assert.Equal (btn, top.MostFocused);
@@ -660,7 +660,7 @@ public class TabViewTests (ITestOutputHelper output)
);
tv.SelectedTab = tab2;
Assert.Equal (tab2, tv.Subviews.First (v => v.Id.Contains ("tabRowView")).MostFocused);
Assert.Equal (tab2, tv.Subviews.First (v => v.Id.Contains ("tabRow")).MostFocused);
tv.Layout ();
View.SetClipToScreen ();
@@ -806,7 +806,7 @@ public class TabViewTests (ITestOutputHelper output)
);
tv.SelectedTab = tab2;
Assert.Equal (tab2, tv.Subviews.First (v => v.Id.Contains ("tabRowView")).MostFocused);
Assert.Equal (tab2, tv.Subviews.First (v => v.Id.Contains ("tabRow")).MostFocused);
tv.Layout ();
View.SetClipToScreen ();