Skip to content

Commit 77ae7ae

Browse files
committed
Rebuildling TabView - WIP
1 parent b48bc2b commit 77ae7ae

File tree

7 files changed

+446
-1065
lines changed

7 files changed

+446
-1065
lines changed

Terminal.Gui/Views/Tab.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#nullable enable
2+
using System.Net.Security;
3+
24
namespace Terminal.Gui;
35

46
/// <summary>A single tab in a <see cref="TabView"/>.</summary>
@@ -11,7 +13,9 @@ public Tab ()
1113
{
1214
BorderStyle = LineStyle.Rounded;
1315
CanFocus = true;
14-
TabStop = TabBehavior.NoStop;
16+
TabStop = TabBehavior.TabStop;
17+
Width = Dim.Auto (DimAutoStyle.Text);
18+
SuperViewRendersLineCanvas = true;
1519
}
1620

1721
/// <summary>The text to display in a <see cref="TabView"/>.</summary>
@@ -26,7 +30,7 @@ public string DisplayText
2630
}
2731
}
2832

29-
/// <summary>The control to display when the tab is selected.</summary>
33+
/// <summary>The View that will be made visible in the <see cref="TabView"/> content area when the tab is selected.</summary>
3034
/// <value></value>
3135
public View? View { get; set; }
3236
}
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
namespace Terminal.Gui;
22

3-
/// <summary>Describes a change in <see cref="TabView.SelectedTab"/></summary>
3+
/// <summary>Describes a change in <see cref="TabView.SelectedTabIndex"/></summary>
44
public class TabChangedEventArgs : EventArgs
55
{
66
/// <summary>Documents a tab change</summary>
7-
/// <param name="oldTab"></param>
8-
/// <param name="newTab"></param>
9-
public TabChangedEventArgs (Tab oldTab, Tab newTab)
7+
/// <param name="oldTabIndex"></param>
8+
/// <param name="newTabIndex"></param>
9+
public TabChangedEventArgs (int? oldTabIndex, int? newTabIndex)
1010
{
11-
OldTab = oldTab;
12-
NewTab = newTab;
11+
OldTabIndex = oldTabIndex;
12+
NewTabIndex = newTabIndex;
1313
}
1414

15-
/// <summary>The currently selected tab. May be null</summary>
16-
public Tab NewTab { get; }
15+
/// <summary>The currently selected tab.</summary>
16+
public int? NewTabIndex { get; }
1717

18-
/// <summary>The previously selected tab. May be null</summary>
19-
public Tab OldTab { get; }
18+
/// <summary>The previously selected tab.</summary>
19+
public int? OldTabIndex{ get; }
2020
}

0 commit comments

Comments
 (0)