mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Initial commit. Made all calls to AnchorEnd() be AnchorEnd(0) in prep
This commit is contained in:
@@ -98,7 +98,7 @@ public class PosTests
|
||||
public void AnchorEnd_SetsValue ()
|
||||
{
|
||||
var n = 0;
|
||||
Pos pos = Pos.AnchorEnd ();
|
||||
Pos pos = Pos.AnchorEnd (0);
|
||||
Assert.Equal ($"AnchorEnd({n})", pos.ToString ());
|
||||
|
||||
n = 5;
|
||||
@@ -122,7 +122,7 @@ public class PosTests
|
||||
|
||||
int Btn_Width () { return btn?.Viewport.Width ?? 0; }
|
||||
|
||||
btn = new Button { Text = "Ok", X = Pos.AnchorEnd () - Pos.Function (Btn_Width) };
|
||||
btn = new Button { Text = "Ok", X = Pos.AnchorEnd (0) - Pos.Function (Btn_Width) };
|
||||
|
||||
var view = new View
|
||||
{
|
||||
@@ -619,7 +619,7 @@ public class PosTests
|
||||
var super = new View { Width = 10, Height = 10, Text = "super" };
|
||||
var view1 = new View { Width = 2, Height = 2, Text = "view1" };
|
||||
var view2 = new View { Width = 2, Height = 2, Text = "view2" };
|
||||
view2.X = Pos.AnchorEnd () - (Pos.Right (view2) - Pos.Left (view2));
|
||||
view2.X = Pos.AnchorEnd (0) - (Pos.Right (view2) - Pos.Left (view2));
|
||||
|
||||
super.Add (view1, view2);
|
||||
super.BeginInit ();
|
||||
|
||||
@@ -405,7 +405,7 @@ public class SetRelativeLayoutTests
|
||||
{
|
||||
var screen = new Size (30, 1);
|
||||
var view = new View { Text = "abc", AutoSize = true }; // BUGBUG: AutoSize or Width must be set
|
||||
view.X = Pos.AnchorEnd () - Pos.Function (GetViewWidth);
|
||||
view.X = Pos.AnchorEnd (0) - Pos.Function (GetViewWidth);
|
||||
|
||||
int GetViewWidth () { return view.Frame.Width; }
|
||||
|
||||
|
||||
@@ -164,8 +164,8 @@ public class ButtonTests (ITestOutputHelper output)
|
||||
var btn = new Button { Y = Pos.Center (), Text = "Say Hello 你", AutoSize = true };
|
||||
var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}";
|
||||
|
||||
btn.X = Pos.AnchorEnd () - Pos.Function (() => btn.TextFormatter.Text.GetColumns ());
|
||||
btn.X = Pos.AnchorEnd () - Pos.Function (() => btn.TextFormatter.Text.GetColumns ());
|
||||
btn.X = Pos.AnchorEnd (0) - Pos.Function (() => btn.TextFormatter.Text.GetColumns ());
|
||||
btn.X = Pos.AnchorEnd (0) - Pos.Function (() => btn.TextFormatter.Text.GetColumns ());
|
||||
|
||||
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill () };
|
||||
win.Add (btn);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class CheckBoxTests
|
||||
{
|
||||
var checkBox = new CheckBox { Y = Pos.Center (), Text = "C_heck this out 你" };
|
||||
|
||||
checkBox.X = Pos.AnchorEnd () - Pos.Function (() => checkBox.GetSizeNeededForTextWithoutHotKey ().Width);
|
||||
checkBox.X = Pos.AnchorEnd (0) - Pos.Function (() => checkBox.GetSizeNeededForTextWithoutHotKey ().Width);
|
||||
|
||||
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
|
||||
win.Add (checkBox);
|
||||
@@ -121,7 +121,7 @@ public class CheckBoxTests
|
||||
{
|
||||
var checkBox = new CheckBox { Y = Pos.Center (), Text = "Check this out 你" };
|
||||
|
||||
checkBox.X = Pos.AnchorEnd () - Pos.Function (() => checkBox.GetSizeNeededForTextWithoutHotKey ().Width);
|
||||
checkBox.X = Pos.AnchorEnd (0) - Pos.Function (() => checkBox.GetSizeNeededForTextWithoutHotKey ().Width);
|
||||
|
||||
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
|
||||
win.Add (checkBox);
|
||||
|
||||
@@ -92,7 +92,7 @@ public class LabelTests
|
||||
public void AutoSize_Stays_True_AnchorEnd ()
|
||||
{
|
||||
var label = new Label { Y = Pos.Center (), Text = "Say Hello 你", AutoSize = true };
|
||||
label.X = Pos.AnchorEnd () - Pos.Function (() => label.TextFormatter.Text.GetColumns ());
|
||||
label.X = Pos.AnchorEnd (0) - Pos.Function (() => label.TextFormatter.Text.GetColumns ());
|
||||
|
||||
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill () };
|
||||
win.Add (label);
|
||||
|
||||
Reference in New Issue
Block a user