Made Arrangement = ViewArrangement.Fixed the default for Toplevels

This commit is contained in:
Tig
2024-04-15 17:08:12 -06:00
parent de1a844787
commit 069089ee27
8 changed files with 45 additions and 28 deletions

View File

@@ -809,7 +809,11 @@ public class ApplicationTests
Init ();
// Don't use Dialog here as it has more layout logic. Use Window instead.
var w = new Window { Width = 5, Height = 5 };
var w = new Window
{
Width = 5, Height = 5,
Arrangement = ViewArrangement.Movable
};
((FakeDriver)Application.Driver).SetBufferSize (10, 10);
RunState rs = Application.Begin (w);

View File

@@ -26,10 +26,10 @@ public class ToplevelTests
}
[Fact]
public void Arrangement_Is_Movable ()
public void Arrangement_Default_Is_Fixed ()
{
var top = new Toplevel ();
Assert.Equal (ViewArrangement.Movable, top.Arrangement);
Assert.Equal (ViewArrangement.Fixed, top.Arrangement);
}
#if BROKE_IN_2927
@@ -869,7 +869,8 @@ public class ToplevelTests
X = 2,
Y = 2,
Width = 10,
Height = 3
Height = 3,
Arrangement = ViewArrangement.Movable
};
Application.Run (testWindow);
}
@@ -964,7 +965,7 @@ public class ToplevelTests
[AutoInitShutdown]
public void Mouse_Drag_On_Top_With_Superview_Not_Null ()
{
var win = new Window { X = 3, Y = 2, Width = 10, Height = 5 };
var win = new Window { X = 3, Y = 2, Width = 10, Height = 5, Arrangement = ViewArrangement.Movable };
Toplevel top = new ();
top.Add (win);
@@ -1331,7 +1332,7 @@ public class ToplevelTests
Height = 16,
ContentSize = new (200, 100)
};
var win = new Window { X = 3, Y = 3, Width = Dim.Fill (3), Height = Dim.Fill (3) };
var win = new Window { X = 3, Y = 3, Width = Dim.Fill (3), Height = Dim.Fill (3), Arrangement = ViewArrangement.Movable };
scrollView.Add (win);
Toplevel top = new ();
top.Add (scrollView);
@@ -1380,7 +1381,7 @@ public class ToplevelTests
public void Window_Viewport_Bigger_Than_Driver_Cols_And_Rows_Allow_Drag_Beyond_Left_Right_And_Bottom ()
{
Toplevel top = new ();
var window = new Window { Width = 20, Height = 3 };
var window = new Window { Width = 20, Height = 3, Arrangement = ViewArrangement.Movable};
RunState rsTop = Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (40, 10);
RunState rsWindow = Application.Begin (window);
@@ -1471,7 +1472,7 @@ public class ToplevelTests
public void Modal_As_Top_Will_Drag_Cleanly ()
{
// Don't use Dialog as a Top, use a Window instead - dialog has complex layout behavior that is not needed here.
var window = new Window { Width = 10, Height = 3 };
var window = new Window { Width = 10, Height = 3, Arrangement = ViewArrangement.Movable };
window.Add (
new Label