Skip to content

Commit

Permalink
Rebuildling TabView - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Nov 6, 2024
1 parent b48bc2b commit 77ae7ae
Show file tree
Hide file tree
Showing 7 changed files with 446 additions and 1,065 deletions.
8 changes: 6 additions & 2 deletions Terminal.Gui/Views/Tab.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#nullable enable
using System.Net.Security;

namespace Terminal.Gui;

/// <summary>A single tab in a <see cref="TabView"/>.</summary>
Expand All @@ -11,7 +13,9 @@ public Tab ()
{
BorderStyle = LineStyle.Rounded;
CanFocus = true;
TabStop = TabBehavior.NoStop;
TabStop = TabBehavior.TabStop;
Width = Dim.Auto (DimAutoStyle.Text);
SuperViewRendersLineCanvas = true;
}

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

/// <summary>The control to display when the tab is selected.</summary>
/// <summary>The View that will be made visible in the <see cref="TabView"/> content area when the tab is selected.</summary>
/// <value></value>
public View? View { get; set; }
}
20 changes: 10 additions & 10 deletions Terminal.Gui/Views/TabChangedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
namespace Terminal.Gui;

/// <summary>Describes a change in <see cref="TabView.SelectedTab"/></summary>
/// <summary>Describes a change in <see cref="TabView.SelectedTabIndex"/></summary>
public class TabChangedEventArgs : EventArgs
{
/// <summary>Documents a tab change</summary>
/// <param name="oldTab"></param>
/// <param name="newTab"></param>
public TabChangedEventArgs (Tab oldTab, Tab newTab)
/// <param name="oldTabIndex"></param>
/// <param name="newTabIndex"></param>
public TabChangedEventArgs (int? oldTabIndex, int? newTabIndex)
{
OldTab = oldTab;
NewTab = newTab;
OldTabIndex = oldTabIndex;
NewTabIndex = newTabIndex;
}

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

/// <summary>The previously selected tab. May be null</summary>
public Tab OldTab { get; }
/// <summary>The previously selected tab.</summary>
public int? OldTabIndex{ get; }
}
Loading

0 comments on commit 77ae7ae

Please sign in to comment.