Skip to content

Commit e09aa54

Browse files
author
tznind
committed
Fixes for shadow style, new unsupported types etc
1 parent 463d76e commit e09aa54

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/ViewFactory.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections.ObjectModel;
22
using System.Data;
33
using Terminal.Gui;
4+
using Terminal.Gui.App;
45
using Terminal.Gui.Drawing;
56
using Terminal.Gui.Input;
67
using Terminal.Gui.ViewBase;
@@ -60,7 +61,9 @@ public static class ViewFactory
6061
typeof(Runnable<>),
6162

6263
// Could proably support later on
63-
typeof(OptionSelector<>)
64+
typeof(OptionSelector<>),
65+
typeof(DropDownList<>),
66+
typeof(Popover<,>)
6467
];
6568

6669
/// <summary>

tests/KeyboardManagerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public void Constructor( )
3131
[Test]
3232
public void Backspace_WithDateFieldSelected( )
3333
{
34-
DateField v = ViewFactory.Create<DateField>( );
35-
Assume.That( v, Is.Not.Null.And.TypeOf<DateField>( ) );
34+
DateEditor v = ViewFactory.Create<DateEditor>( );
35+
Assume.That( v, Is.Not.Null.And.TypeOf<DateEditor>( ) );
3636

3737
FileInfo? file = null;
3838
Assume.That( ( ) => file = new( "ff.cs" ), Throws.Nothing );

tests/Operations/AddViewOperationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ internal class AddViewOperationTests : Tests
1717
{
1818
typeof(TextField),
1919
typeof(TextView),
20-
typeof(DateField),
21-
typeof(TimeField),
20+
typeof(DateEditor),
21+
typeof(TimeEditor),
2222
};
2323

2424
[Test( Description = "Tests AddViewOperation against all SupportedViewTypes" )]

tests/UI/MouseManagerTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void DragResizeView<T>( [ValueSource( nameof( DragResizeView_Types ) )] T
2626

2727
if (view is Button btn)
2828
{
29-
btn.ShadowStyle = ShadowStyle.None;
29+
btn.ShadowStyle = ShadowStyles.None;
3030
}
3131

3232
Assert.That( view.GetContentSize().Width, Is.EqualTo( 8 ) );
@@ -97,15 +97,14 @@ public void DragResize_ShadowButton()
9797
using Button btn = ViewFactory.Create<Button>();
9898
btn.Width = 8;
9999
btn.Height = 2;
100-
btn.ShadowStyle = ShadowStyle.Opaque;
100+
btn.ShadowStyle = ShadowStyles.Opaque;
101101

102102
Design design = new(App, d.SourceCode, "myView", btn);
103103
btn.Data = design;
104104
d.View.Add(btn);
105105

106106
Assert.That(btn.Margin, Is.Not.Null);
107-
Assert.That(btn.Margin!.IsAdornment(), Is.True);
108-
var shadow = btn.Margin!.SubViews.ElementAt(0);
107+
var shadow = btn.Margin.View!.SubViews.ElementAt(0);
109108
Assert.That(shadow,Is.InstanceOf<ShadowView>());
110109
Assert.That(shadow.IsAdornment,Is.True);
111110
Assert.That(shadow.GetAdornmentParent(),Is.SameAs(btn));

0 commit comments

Comments
 (0)