Skip to content

Commit 7682631

Browse files
author
tznind
committed
TabView has been deleted :(
1 parent 3a091bc commit 7682631

30 files changed

Lines changed: 18 additions & 1310 deletions

Showcase/Showcase.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.5217 " />
12+
<PackageReference Include="Terminal.Gui" Version="2.0.0-develop.5281 " />
1313
</ItemGroup>
1414

1515
</Project>

src/Design.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using TerminalGuiDesigner.Operations.MenuOperations;
1616
using TerminalGuiDesigner.Operations.StatusBarOperations;
1717
using TerminalGuiDesigner.Operations.TableViewOperations;
18-
using TerminalGuiDesigner.Operations.TabOperations;
1918
using TerminalGuiDesigner.ToCode;
2019

2120
namespace TerminalGuiDesigner;
@@ -42,15 +41,13 @@ public class Design
4241
private readonly HashSet<Type> excludeTextPropertyFor = new()
4342
{
4443
typeof(FrameView),
45-
typeof(TabView),
4644
typeof(Window),
4745
typeof(GraphView),
4846
typeof(HexView),
4947
typeof(Line),
5048
typeof(ListView),
5149
typeof(MenuBar),
5250
typeof(TableView),
53-
typeof(TabView),
5451
typeof(TreeView),
5552
typeof(Dialog),
5653
typeof(NumericUpDown),
@@ -356,20 +353,6 @@ public IEnumerable<IOperation> GetExtraOperations(Point pos)
356353

357354
switch ( this.View )
358355
{
359-
case TabView tabView:
360-
{
361-
yield return new AddTabOperation(App, this, null);
362-
363-
if (tabView.SelectedTab != null)
364-
{
365-
yield return new RemoveTabOperation(App, this, tabView.SelectedTab);
366-
yield return new RenameTabOperation(App, this, tabView.SelectedTab, null);
367-
yield return new MoveTabOperation(App, this, tabView.SelectedTab, -1);
368-
yield return new MoveTabOperation(App, this, tabView.SelectedTab, 1);
369-
}
370-
371-
break;
372-
}
373356
case MenuBar mb:
374357
{
375358
yield return new AddMenuOperation(App, this, null);
@@ -798,15 +781,6 @@ private IEnumerable<Property> LoadDesignableProperties()
798781
yield return this.CreateSubProperty(nameof(TableStyle.ShowVerticalHeaderLines), nameof(TableView.Style), tv.Style);
799782
}
800783

801-
if (this.View is TabView tabView)
802-
{
803-
yield return this.CreateProperty(nameof(TabView.MaxTabTextWidth));
804-
805-
yield return this.CreateSubProperty(nameof(TabStyle.ShowBorder), nameof(TabView.Style), tabView.Style);
806-
yield return this.CreateSubProperty(nameof(TabStyle.ShowTopLine), nameof(TabView.Style), tabView.Style);
807-
yield return this.CreateSubProperty(nameof(TabStyle.TabsOnBottom), nameof(TabView.Style), tabView.Style);
808-
}
809-
810784
if (this.View is OptionSelector)
811785
{
812786
yield return this.CreateProperty(nameof(OptionSelector.Labels));

src/MenuBarExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static class MenuBarExtensions
4646
return null;
4747
}
4848

49-
var clientPoint = menuBar.ScreenToContent(new Point(screenX, 0));
49+
var clientPoint = menuBar.ScreenToViewport(new Point(screenX, 0));
5050

5151
// if click is not in our client area
5252
if (clientPoint.X < initialWhitespace)

src/Operations/AddViewOperation.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ private string TypeNameDelegate(Type? t)
143143

144144
private View GetViewToAddTo()
145145
{
146-
if (this.to.View is TabView tabView)
147-
{
148-
return tabView.SelectedTab.View;
149-
}
150-
151146
return this.to.View;
152147
}
153148
}

src/Operations/DragOperation.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ public View? DropInto
137137
return;
138138
}
139139

140-
// When dropping onto a TabView
141-
if (value is TabView tv && tv.SelectedTab != null && tv.SelectedTab.View != null)
142-
{
143-
// Add to the content area of the selected tab instead
144-
value = tv.SelectedTab.View;
145-
}
146-
147140
this.dropInto = value;
148141

149142

src/Operations/OperationFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private IEnumerable<IOperation> CreateOperations(Mouse? m, Design d)
109109
{
110110
var ops = m == null || !m.Position.HasValue?
111111
d.GetExtraOperations() :
112-
d.GetExtraOperations(d.View.ScreenToContent(m.Position.Value));
112+
d.GetExtraOperations(d.View.ScreenToViewport(m.Position.Value));
113113

114114
foreach (var extra in ops.Where(c => !c.IsImpossible))
115115
{

src/Operations/PasteOperation.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ private bool Paste(Design copy, Design into)
160160

161161
this.CopyProperties(copy, cloneDesign);
162162

163-
if (clone is TabView tabView)
164-
{
165-
this.CloneTabView((TabView)copy.View, tabView);
166-
}
167-
else
168163
if (copy.IsContainerView)
169164
{
170165
foreach (var content in copy.View.GetActualSubviews())
@@ -225,30 +220,6 @@ private void CloneTableView(TableView copy, TableView pasted)
225220
pasted.Update();
226221
}
227222

228-
private void CloneTabView(TabView copy, TabView pasted)
229-
{
230-
// clear tabs in the pasted view as they will just come from ViewFactory
231-
foreach (var tab in pasted.Tabs.ToArray())
232-
{
233-
pasted.RemoveTab(tab);
234-
}
235-
236-
// add a new Tab for each one in the source
237-
foreach (var copyTab in copy.Tabs)
238-
{
239-
var tab = pasted.AddEmptyTab(copyTab.DisplayText?.ToString() ?? Operation.Unnamed);
240-
241-
// copy the tab contents
242-
copy.SelectedTab = copyTab;
243-
pasted.SelectedTab = tab;
244-
245-
foreach (var copySub in copyTab.View.GetActualSubviews())
246-
{
247-
this.Paste(copySub, (Design)pasted.Data);
248-
}
249-
}
250-
}
251-
252223
private void MigratePosRelatives()
253224
{
254225
var everyone = this.to.GetAllDesigns().ToArray();

src/Operations/TabOperations/AddTabOperation.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Operations/TabOperations/MoveTabOperation.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Operations/TabOperations/RemoveTabOperation.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)