mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
merged again
This commit is contained in:
@@ -30,8 +30,7 @@
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.1" />
|
||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
||||
<InternalsVisibleTo Include="UnitTests" />
|
||||
|
||||
</ItemGroup>
|
||||
</ItemGroup>
|
||||
<!-- Uncomment the RestoreSources element to have dotnet restore pull NStack from a local dir for testing -->
|
||||
<PropertyGroup>
|
||||
<!-- See https://stackoverflow.com/a/44463578/297526 -->
|
||||
@@ -61,7 +60,6 @@
|
||||
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472;netstandard2.0;net6.0</TargetFrameworks>
|
||||
<LangVersion>9</LangVersion>
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace UICatalog {
|
||||
// a Scenario was selected. Otherwise, the user wants to exit UI Catalog.
|
||||
Application.Init ();
|
||||
|
||||
//Application.EnableConsoleScrolling = _enableConsoleScrolling;
|
||||
Application.EnableConsoleScrolling = _enableConsoleScrolling;
|
||||
|
||||
Application.Run<UICatalogTopLevel> ();
|
||||
Application.Shutdown ();
|
||||
@@ -219,7 +219,7 @@ namespace UICatalog {
|
||||
|
||||
static bool _useSystemConsole = false;
|
||||
static ConsoleDriver.DiagnosticFlags _diagnosticFlags;
|
||||
// static bool _enableConsoleScrolling = false;
|
||||
static bool _enableConsoleScrolling = false;
|
||||
static bool _isFirstRunning = true;
|
||||
static string _topLevelColorScheme;
|
||||
|
||||
|
||||
@@ -475,32 +475,32 @@ namespace Terminal.Gui.TypeTests {
|
||||
Assert.Equal (200, w.Frame.Height);
|
||||
|
||||
f1.Text = "Frame1";
|
||||
Assert.Equal ("Factor(0.5,False)", f1.Width.ToString ());
|
||||
Assert.Equal ("Absolute(5)", f1.Height.ToString ());
|
||||
Assert.Equal ("DimFactor(0.5,False)", f1.Width.ToString ());
|
||||
Assert.Equal ("DimAbsolute(5)", f1.Height.ToString ());
|
||||
Assert.Equal (99, f1.Frame.Width); // 100-1=99
|
||||
Assert.Equal (5, f1.Frame.Height);
|
||||
|
||||
f2.Text = "Frame2";
|
||||
Assert.Equal ("Fill(0)", f2.Width.ToString ());
|
||||
Assert.Equal ("Absolute(5)", f2.Height.ToString ());
|
||||
Assert.Equal ("DimFill(0)", f2.Width.ToString ());
|
||||
Assert.Equal ("DimAbsolute(5)", f2.Height.ToString ());
|
||||
Assert.Equal (99, f2.Frame.Width); // 100-1=99
|
||||
Assert.Equal (5, f2.Frame.Height);
|
||||
|
||||
v1.Text = "Button1";
|
||||
Assert.Equal ("Combine(DimView(Width,FrameView()({X=0,Y=0,Width=99,Height=5}))-Absolute(2))", v1.Width.ToString ());
|
||||
Assert.Equal ("Combine(Fill(0)-Absolute(2))", v1.Height.ToString ());
|
||||
Assert.Equal ("DimCombine(DimView(Width,FrameView()({X=0,Y=0,Width=99,Height=5}))-DimAbsolute(2))", v1.Width.ToString ());
|
||||
Assert.Equal ("DimCombine(DimFill(0)-DimAbsolute(2))", v1.Height.ToString ());
|
||||
Assert.Equal (97, v1.Frame.Width); // 99-2=97
|
||||
Assert.Equal (189, v1.Frame.Height); // 198-2-7=189
|
||||
|
||||
v2.Text = "Button2";
|
||||
Assert.Equal ("Combine(DimView(Width,FrameView()({X=99,Y=0,Width=99,Height=5}))-Absolute(2))", v2.Width.ToString ());
|
||||
Assert.Equal ("Combine(Fill(0)-Absolute(2))", v2.Height.ToString ());
|
||||
Assert.Equal ("DimCombine(DimView(Width,FrameView()({X=99,Y=0,Width=99,Height=5}))-DimAbsolute(2))", v2.Width.ToString ());
|
||||
Assert.Equal ("DimCombine(DimFill(0)-DimAbsolute(2))", v2.Height.ToString ());
|
||||
Assert.Equal (97, v2.Frame.Width); // 99-2=97
|
||||
Assert.Equal (189, v2.Frame.Height); // 198-2-7=189
|
||||
|
||||
v3.Text = "Button3";
|
||||
Assert.Equal ("Factor(0.1,False)", v3.Width.ToString ());
|
||||
Assert.Equal ("Factor(0.1,False)", v3.Height.ToString ());
|
||||
Assert.Equal ("DimFactor(0.1,False)", v3.Width.ToString ());
|
||||
Assert.Equal ("DimFactor(0.1,False)", v3.Height.ToString ());
|
||||
Assert.Equal (19, v3.Frame.Width); // 198*10%=19 * Percent is related to the super-view if it isn't null otherwise the view width
|
||||
Assert.Equal (19, v3.Frame.Height); // 199*10%=19
|
||||
|
||||
@@ -517,14 +517,14 @@ namespace Terminal.Gui.TypeTests {
|
||||
Assert.Equal (1, v4.Frame.Height); // 1 because is Dim.DimAbsolute
|
||||
|
||||
v5.Text = "Button5";
|
||||
Assert.Equal ("Combine(DimView(Width,Button()({X=2,Y=7,Width=97,Height=189}))-DimView(Width,Button()({X=0,Y=0,Width=19,Height=19})))", v5.Width.ToString ());
|
||||
Assert.Equal ("Combine(DimView(Height,Button()({X=2,Y=7,Width=97,Height=189}))-DimView(Height,Button()({X=0,Y=0,Width=19,Height=19})))", v5.Height.ToString ());
|
||||
Assert.Equal ("DimCombine(DimView(Width,Button()({X=2,Y=7,Width=97,Height=189}))-DimView(Width,Button()({X=0,Y=0,Width=19,Height=19})))", v5.Width.ToString ());
|
||||
Assert.Equal ("DimCombine(DimView(Height,Button()({X=2,Y=7,Width=97,Height=189}))-DimView(Height,Button()({X=0,Y=0,Width=19,Height=19})))", v5.Height.ToString ());
|
||||
Assert.Equal (78, v5.Frame.Width); // 97-19=78
|
||||
Assert.Equal (170, v5.Frame.Height); // 189-19=170
|
||||
|
||||
v6.Text = "Button6";
|
||||
Assert.Equal ("Factor(0.2,True)", v6.Width.ToString ());
|
||||
Assert.Equal ("Factor(0.2,True)", v6.Height.ToString ());
|
||||
Assert.Equal ("DimFactor(0.2,True)", v6.Width.ToString ());
|
||||
Assert.Equal ("DimFactor(0.2,True)", v6.Height.ToString ());
|
||||
Assert.Equal (19, v6.Frame.Width); // 99*20%=19
|
||||
Assert.Equal (38, v6.Frame.Height); // 198-7*20=38
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user