瀏覽代碼

Simplified Alignment enum

Tig 1 年之前
父節點
當前提交
c877c1844d
共有 54 個文件被更改,包括 810 次插入911 次删除
  1. 6 11
      Terminal.Gui/Drawing/Aligner.cs
  2. 25 112
      Terminal.Gui/Drawing/Alignment.cs
  3. 2 2
      Terminal.Gui/Drawing/Thickness.cs
  4. 1 1
      Terminal.Gui/Resources/config.json
  5. 27 27
      Terminal.Gui/Text/TextFormatter.cs
  6. 2 2
      Terminal.Gui/Views/Button.cs
  7. 4 4
      Terminal.Gui/Views/CheckBox.cs
  8. 1 1
      Terminal.Gui/Views/Dialog.cs
  9. 1 1
      Terminal.Gui/Views/ListView.cs
  10. 1 1
      Terminal.Gui/Views/Menu/Menu.cs
  11. 2 2
      Terminal.Gui/Views/MessageBox.cs
  12. 1 1
      Terminal.Gui/Views/ProgressBar.cs
  13. 6 12
      Terminal.Gui/Views/Slider.cs
  14. 5 5
      Terminal.Gui/Views/TableView/TableView.cs
  15. 7 7
      Terminal.Gui/Views/TextValidateField.cs
  16. 1 1
      Terminal.Gui/Views/TextView.cs
  17. 1 1
      Terminal.Gui/Views/Wizard/Wizard.cs
  18. 2 2
      UICatalog/Scenarios/BasicColors.cs
  19. 25 25
      UICatalog/Scenarios/Buttons.cs
  20. 1 1
      UICatalog/Scenarios/CharacterMap.cs
  21. 2 2
      UICatalog/Scenarios/CollectionNavigatorTester.cs
  22. 2 2
      UICatalog/Scenarios/ColorPicker.cs
  23. 13 13
      UICatalog/Scenarios/ComputedLayout.cs
  24. 10 10
      UICatalog/Scenarios/CsvEditor.cs
  25. 7 7
      UICatalog/Scenarios/Dialogs.cs
  26. 2 2
      UICatalog/Scenarios/DynamicMenuBar.cs
  27. 9 9
      UICatalog/Scenarios/Editor.cs
  28. 1 1
      UICatalog/Scenarios/ListColumns.cs
  29. 9 9
      UICatalog/Scenarios/MessageBoxes.cs
  30. 2 2
      UICatalog/Scenarios/Mouse.cs
  31. 4 4
      UICatalog/Scenarios/PosAlignDemo.cs
  32. 9 9
      UICatalog/Scenarios/ProgressBarStyles.cs
  33. 7 7
      UICatalog/Scenarios/TableEditor.cs
  34. 1 1
      UICatalog/Scenarios/Text.cs
  35. 42 42
      UICatalog/Scenarios/TextAlignmentAndDirection.cs
  36. 1 1
      UICatalog/Scenarios/TextFormatterDemo.cs
  37. 6 6
      UICatalog/Scenarios/TimeAndDate.cs
  38. 1 1
      UICatalog/Scenarios/Unicode.cs
  39. 5 5
      UICatalog/Scenarios/ViewExperiments.cs
  40. 4 4
      UICatalog/Scenarios/Wizards.cs
  41. 3 3
      UnitTests/Configuration/ThemeScopeTests.cs
  42. 2 2
      UnitTests/Configuration/ThemeTests.cs
  43. 45 45
      UnitTests/Dialogs/DialogTests.cs
  44. 298 298
      UnitTests/Drawing/AlignerTests.cs
  45. 143 143
      UnitTests/Text/TextFormatterTests.cs
  46. 2 2
      UnitTests/View/DrawTests.cs
  47. 6 6
      UnitTests/View/Layout/Dim.AutoTests.cs
  48. 10 13
      UnitTests/View/Layout/Pos.AlignTests.cs
  49. 7 7
      UnitTests/View/TextTests.cs
  50. 4 4
      UnitTests/Views/ButtonTests.cs
  51. 9 9
      UnitTests/Views/CheckBoxTests.cs
  52. 1 1
      UnitTests/Views/LabelTests.cs
  53. 20 20
      UnitTests/Views/TextValidateFieldTests.cs
  54. 2 2
      UnitTests/Views/ToplevelTests.cs

+ 6 - 11
Terminal.Gui/Drawing/Aligner.cs

@@ -114,8 +114,7 @@ public class Aligner : INotifyPropertyChanged
 
         switch (alignment)
         {
-            case Alignment.Left:
-            case Alignment.Top:
+            case Alignment.Start:
                 var currentPosition = 0;
 
                 for (var i = 0; i < sizes.Length; i++)
@@ -137,9 +136,7 @@ public class Aligner : INotifyPropertyChanged
 
                 break;
 
-            case Alignment.Right:
-            case Alignment.Bottom:
-
+            case Alignment.End:
                 currentPosition = containerSize - totalItemsSize - spaces;
 
                 for (var i = 0; i < sizes.Length; i++)
@@ -153,7 +150,7 @@ public class Aligner : INotifyPropertyChanged
 
                 break;
 
-            case Alignment.Centered:
+            case Alignment.Center:
                 if (sizes.Length > 1)
                 {
                     // remaining space to be distributed before first and after the items
@@ -184,7 +181,7 @@ public class Aligner : INotifyPropertyChanged
 
                 break;
 
-            case Alignment.Justified:
+            case Alignment.Fill:
                 int spaceBetween = sizes.Length > 1 ? (containerSize - totalItemsSize) / (sizes.Length - 1) : 0;
                 int remainder = sizes.Length > 1 ? (containerSize - totalItemsSize) % (sizes.Length - 1) : 0;
                 currentPosition = 0;
@@ -200,8 +197,7 @@ public class Aligner : INotifyPropertyChanged
                 break;
 
             // 111 2222        33333
-            case Alignment.LastRightRestLeft:
-            case Alignment.LastBottomRestTop:
+            case Alignment.LastEndRestStart:
                 if (sizes.Length > 1)
                 {
                     if (totalItemsSize > containerSize)
@@ -238,8 +234,7 @@ public class Aligner : INotifyPropertyChanged
                 break;
 
             // 111        2222 33333
-            case Alignment.FirstLeftRestRight:
-            case Alignment.FirstTopRestBottom:
+            case Alignment.FirstStartRestEnd:
                 if (sizes.Length > 1)
                 {
                     currentPosition = 0;

+ 25 - 112
Terminal.Gui/Drawing/Alignment.cs

@@ -1,191 +1,104 @@
 namespace Terminal.Gui;
 
 /// <summary>
-///     Controls how the <see cref="Aligner"/> aligns items within a container.
+///     Determines the position of items when arranged in a container.
 /// </summary>
 public enum Alignment
 {
     /// <summary>
-    ///     The items will be aligned to the left.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one space between
-    ///     each item.
+    ///     The items will be aligned to the start (left or top) of the container.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         If the container is smaller than the total size of the items, the right items will be clipped (their locations
+    ///         If the container is smaller than the total size of the items, the end items will be clipped (their locations
     ///         will be greater than the container size).
     ///     </para>
-    ///     <para>
-    ///         <see cref="Left"/> and <see cref="Top"/> have equivalent behavior.
-    ///     </para>
     /// </remarks>
     /// <example>
     ///     <c>
-    ///         111 2222 33333
+    ///         |111 2222 33333    |
     ///     </c>
     /// </example>
-    Left = 0,
+    Start = 0,
 
     /// <summary>
-    ///     The items will be aligned to the top.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one line between
-    ///     each item.
+    ///     The items will be aligned to the end (right or bottom) of the container.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         If the container is smaller than the total size of the items, the bottom items will be clipped (their locations
-    ///         will be greater than the container size).
-    ///     </para>
-    ///     <para>
-    ///         <see cref="Left"/> and <see cref="Top"/> have equivalent behavior.
-    ///     </para>
-    /// </remarks>
-    Top,
-
-    /// <summary>
-    ///     The items will be aligned to the right.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one space between
-    ///     each item.
-    /// </summary>
-    /// <remarks>
-    ///     <para>
-    ///         If the container is smaller than the total size of the items, the left items will be clipped (their locations
+    ///         If the container is smaller than the total size of the items, the start items will be clipped (their locations
     ///         will be negative).
     ///     </para>
-    ///     <para>
-    ///         <see cref="Right"/> and <see cref="Bottom"/> have equivalent behavior.
-    ///     </para>
     /// </remarks>
     /// <example>
     ///     <c>
-    ///         111 2222 33333
+    ///         |    111 2222 33333|
     ///     </c>
     /// </example>
-    Right,
+    End,
 
     /// <summary>
-    ///     The items will be aligned to the bottom.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one line between
-    ///     each item.
+    ///     Center in the available space.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         If the container is smaller than the total size of the items, the top items will be clipped (their locations
-    ///         will be negative).
-    ///     </para>
-    ///     <para>
-    ///         <see cref="Right"/> and <see cref="Bottom"/> have equivalent behavior.
-    ///     </para>
-    /// </remarks>
-    Bottom,
-
-    /// <summary>
-    ///     The group will be centered in the container.
     ///     If centering is not possible, the group will be left-aligned.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one space between
-    ///     each item.
-    /// </summary>
-    /// <remarks>
+    ///     </para>
     ///     <para>
     ///         Extra space will be distributed between the items, biased towards the left.
     ///     </para>
     /// </remarks>
     /// <example>
     ///     <c>
-    ///         111 2222 33333
+    ///         |  111 2222 33333  |
     ///     </c>
     /// </example>
-    Centered,
+    Center,
 
     /// <summary>
-    ///     The items will be justified. Space will be added between the items such that the first item
-    ///     is at the start and the right side of the last item against the end.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one space between
-    ///     each item.
+    ///     The items will fill the available space.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         Extra space will be distributed between the items, biased towards the left.
+    ///         Extra space will be distributed between the items, biased towards the end.
     ///     </para>
     /// </remarks>
     /// <example>
     ///     <c>
-    ///         111    2222     33333
+    ///        |111  2222    33333|
     ///     </c>
     /// </example>
-    Justified,
+    Fill,
 
     /// <summary>
-    ///     The first item will be aligned to the left and the remaining will aligned to the right.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one space between
-    ///     each item.
+    ///     The first item will be aligned to the start and the remaining will aligned to the end.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         If the container is smaller than the total size of the items, the right items will be clipped (their locations
+    ///         If the container is smaller than the total size of the items, the end items will be clipped (their locations
     ///         will be greater than the container size).
     ///     </para>
-    ///     <para>
-    ///         <see cref="FirstLeftRestRight"/> and <see cref="FirstTopRestBottom"/> have equivalent behavior.
-    ///     </para>
     /// </remarks>
     /// <example>
     ///     <c>
-    ///         111        2222 33333
+    ///         |111     2222 33333|
     ///     </c>
     /// </example>
-    FirstLeftRestRight,
-
-    /// <summary>
-    ///     The first item will be aligned to the top and the remaining will aligned to the bottom.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one line between
-    ///     each item.
-    /// </summary>
-    /// <remarks>
-    ///     <para>
-    ///         If the container is smaller than the total size of the items, the bottom items will be clipped (their locations
-    ///         will be greater than the container size).
-    ///     </para>
-    ///     <para>
-    ///         <see cref="FirstLeftRestRight"/> and <see cref="FirstTopRestBottom"/> have equivalent behavior.
-    ///     </para>
-    /// </remarks>
-    FirstTopRestBottom,
+    FirstStartRestEnd,
 
     /// <summary>
-    ///     The last item will be aligned to the right and the remaining will aligned to the left.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one space between
-    ///     each item.
+    ///     The last item will be aligned to the end and the remaining will aligned to the start.
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         If the container is smaller than the total size of the items, the left items will be clipped (their locations
+    ///         If the container is smaller than the total size of the items, the start items will be clipped (their locations
     ///         will be negative).
     ///     </para>
-    ///     <para>
-    ///         <see cref="LastRightRestLeft"/> and <see cref="LastBottomRestTop"/> have equivalent behavior.
-    ///     </para>
     /// </remarks>
     /// <example>
     ///     <c>
-    ///         111 2222        33333
+    ///         |111 2222      33333|
     ///     </c>
     /// </example>
-    LastRightRestLeft,
-
-    /// <summary>
-    ///     The last item will be aligned to the bottom and the remaining will aligned to the left.
-    ///     Set <see cref="Aligner.SpaceBetweenItems"/> to <see langword="true"/> to ensure at least one line between
-    ///     each item.
-    /// </summary>
-    /// <remarks>
-    ///     <para>
-    ///         If the container is smaller than the total size of the items, the top items will be clipped (their locations
-    ///         will be negative).
-    ///     </para>
-    ///     <para>
-    ///         <see cref="LastRightRestLeft"/> and <see cref="LastBottomRestTop"/> have equivalent behavior.
-    ///     </para>
-    /// </remarks>
-    LastBottomRestTop
+    LastEndRestStart
 }

+ 2 - 2
Terminal.Gui/Drawing/Thickness.cs

@@ -230,8 +230,8 @@ public class Thickness : IEquatable<Thickness>
             var tf = new TextFormatter
             {
                 Text = label is null ? string.Empty : $"{label} {this}",
-                Alignment = Alignment.Centered,
-                VerticalAlignment = Alignment.Bottom,
+                Alignment = Alignment.Center,
+                VerticalAlignment = Alignment.End,
                 AutoSize = true
             };
             tf.Draw (rect, Application.Driver.CurrentAttribute, Application.Driver.CurrentAttribute, rect);

+ 1 - 1
Terminal.Gui/Resources/config.json

@@ -24,7 +24,7 @@
   "Themes": [
     {
       "Default": {
-        "Dialog.DefaultButtonAlignment": "Right",
+        "Dialog.DefaultButtonAlignment": "End",
         "FrameView.DefaultBorderStyle": "Single",
         "Window.DefaultBorderStyle": "Single",
         "ColorSchemes": [

+ 27 - 27
Terminal.Gui/Text/TextFormatter.cs

@@ -17,9 +17,9 @@ public class TextFormatter
     private Size _size;
     private int _tabWidth = 4;
     private string _text;
-    private Alignment _textAlignment = Alignment.Left;
+    private Alignment _textAlignment = Alignment.Start;
     private TextDirection _textDirection;
-    private Alignment _textVerticalAlignment = Alignment.Top;
+    private Alignment _textVerticalAlignment = Alignment.Start;
     private bool _wordWrap = true;
 
     /// <summary>Get or sets the horizontal text alignment.</summary>
@@ -34,7 +34,7 @@ public class TextFormatter
     /// <remarks>
     ///     <para>Used when <see cref="View"/> is using <see cref="Dim.Auto"/> to resize the view's <see cref="View.Viewport"/> to fit <see cref="Size"/>.</para>
     ///     <para>
-    ///         AutoSize is ignored if <see cref="Alignment.Justified"/> is used.
+    ///         AutoSize is ignored if <see cref="Gui.Alignment.Fill"/> is used.
     ///     </para>
     /// </remarks>
     public bool AutoSize
@@ -322,7 +322,7 @@ public class TextFormatter
             int x = 0, y = 0;
 
             // Horizontal Alignment
-            if (Alignment is Alignment.Right)
+            if (Alignment is Alignment.End)
             {
                 if (isVertical)
                 {
@@ -337,7 +337,7 @@ public class TextFormatter
                     CursorPosition = screen.Width - runesWidth + (_hotKeyPos > -1 ? _hotKeyPos : 0);
                 }
             }
-            else if (Alignment is Alignment.Left)
+            else if (Alignment is Alignment.Start)
             {
                 if (isVertical)
                 {
@@ -353,7 +353,7 @@ public class TextFormatter
 
                 CursorPosition = _hotKeyPos > -1 ? _hotKeyPos : 0;
             }
-            else if (Alignment is Alignment.Justified)
+            else if (Alignment is Alignment.Fill)
             {
                 if (isVertical)
                 {
@@ -376,7 +376,7 @@ public class TextFormatter
 
                 CursorPosition = _hotKeyPos > -1 ? _hotKeyPos : 0;
             }
-            else if (Alignment is Alignment.Centered)
+            else if (Alignment is Alignment.Center)
             {
                 if (isVertical)
                 {
@@ -402,7 +402,7 @@ public class TextFormatter
             }
 
             // Vertical Alignment
-            if (VerticalAlignment is Alignment.Bottom)
+            if (VerticalAlignment is Alignment.End)
             {
                 if (isVertical)
                 {
@@ -413,7 +413,7 @@ public class TextFormatter
                     y = screen.Bottom - linesFormatted.Count + line;
                 }
             }
-            else if (VerticalAlignment is Alignment.Top)
+            else if (VerticalAlignment is Alignment.Start)
             {
                 if (isVertical)
                 {
@@ -424,7 +424,7 @@ public class TextFormatter
                     y = screen.Top + line;
                 }
             }
-            else if (VerticalAlignment is Alignment.Justified)
+            else if (VerticalAlignment is Alignment.Fill)
             {
                 if (isVertical)
                 {
@@ -438,7 +438,7 @@ public class TextFormatter
                         line < linesFormatted.Count - 1 ? screen.Height - interval <= 1 ? screen.Top + 1 : screen.Top + line * interval : screen.Bottom - 1;
                 }
             }
-            else if (VerticalAlignment is Alignment.Centered)
+            else if (VerticalAlignment is Alignment.Center)
             {
                 if (isVertical)
                 {
@@ -476,8 +476,8 @@ public class TextFormatter
                 {
                     if (idx < 0
                         || (isVertical
-                                ? VerticalAlignment != Alignment.Bottom && current < 0
-                                : Alignment != Alignment.Right && x + current + colOffset < 0))
+                                ? VerticalAlignment != Alignment.End && current < 0
+                                : Alignment != Alignment.End && x + current + colOffset < 0))
                     {
                         current++;
 
@@ -566,7 +566,7 @@ public class TextFormatter
 
                 if (HotKeyPos > -1 && idx == HotKeyPos)
                 {
-                    if ((isVertical && VerticalAlignment == Alignment.Justified) || (!isVertical && Alignment == Alignment.Justified))
+                    if ((isVertical && VerticalAlignment == Alignment.Fill) || (!isVertical && Alignment == Alignment.Fill))
                     {
                         CursorPosition = idx - start;
                     }
@@ -704,7 +704,7 @@ public class TextFormatter
                 _lines = Format (
                                  text,
                                  Size.Height,
-                                 VerticalAlignment == Alignment.Justified,
+                                 VerticalAlignment == Alignment.Fill,
                                  Size.Width > colsWidth && WordWrap,
                                  PreserveTrailingSpaces,
                                  TabWidth,
@@ -728,7 +728,7 @@ public class TextFormatter
                 _lines = Format (
                                  text,
                                  Size.Width,
-                                 Alignment == Alignment.Justified,
+                                 Alignment == Alignment.Fill,
                                  Size.Height > 1 && WordWrap,
                                  PreserveTrailingSpaces,
                                  TabWidth,
@@ -1036,7 +1036,7 @@ public class TextFormatter
         List<Rune> runes = StripCRLF (text).ToRuneList ();
 
         int start = Math.Max (
-                              !runes.Contains ((Rune)' ') && textFormatter is { VerticalAlignment: Alignment.Bottom } && IsVerticalDirection (textDirection)
+                              !runes.Contains ((Rune)' ') && textFormatter is { VerticalAlignment: Alignment.End } && IsVerticalDirection (textDirection)
                                   ? runes.Count - width
                                   : 0,
                               0);
@@ -1268,7 +1268,7 @@ public class TextFormatter
         TextFormatter textFormatter = null
     )
     {
-        return ClipAndJustify (text, width, textAlignment == Alignment.Justified, textDirection, tabWidth, textFormatter);
+        return ClipAndJustify (text, width, textAlignment == Alignment.Fill, textDirection, tabWidth, textFormatter);
     }
 
     /// <summary>Justifies text within a specified width.</summary>
@@ -1309,12 +1309,12 @@ public class TextFormatter
         {
             if (IsHorizontalDirection (textDirection))
             {
-                if (textFormatter is { Alignment: Alignment.Right })
+                if (textFormatter is { Alignment: Alignment.End })
                 {
                     return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection);
                 }
 
-                if (textFormatter is { Alignment: Alignment.Centered })
+                if (textFormatter is { Alignment: Alignment.Center })
                 {
                     return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection);
                 }
@@ -1324,12 +1324,12 @@ public class TextFormatter
 
             if (IsVerticalDirection (textDirection))
             {
-                if (textFormatter is { VerticalAlignment: Alignment.Bottom })
+                if (textFormatter is { VerticalAlignment: Alignment.End })
                 {
                     return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection);
                 }
 
-                if (textFormatter is { VerticalAlignment: Alignment.Centered })
+                if (textFormatter is { VerticalAlignment: Alignment.Center })
                 {
                     return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection);
                 }
@@ -1347,14 +1347,14 @@ public class TextFormatter
 
         if (IsHorizontalDirection (textDirection))
         {
-            if (textFormatter is { Alignment: Alignment.Right })
+            if (textFormatter is { Alignment: Alignment.End })
             {
                 if (GetRuneWidth (text, tabWidth, textDirection) > width)
                 {
                     return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection);
                 }
             }
-            else if (textFormatter is { Alignment: Alignment.Centered })
+            else if (textFormatter is { Alignment: Alignment.Center })
             {
                 return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection);
             }
@@ -1366,14 +1366,14 @@ public class TextFormatter
 
         if (IsVerticalDirection (textDirection))
         {
-            if (textFormatter is { VerticalAlignment: Alignment.Bottom })
+            if (textFormatter is { VerticalAlignment: Alignment.End })
             {
                 if (runes.Count - zeroLength > width)
                 {
                     return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection);
                 }
             }
-            else if (textFormatter is { VerticalAlignment: Alignment.Centered })
+            else if (textFormatter is { VerticalAlignment: Alignment.Center })
             {
                 return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection);
             }
@@ -1515,7 +1515,7 @@ public class TextFormatter
         return Format (
                        text,
                        width,
-                       textAlignment == Alignment.Justified,
+                       textAlignment == Alignment.Fill,
                        wordWrap,
                        preserveTrailingSpaces,
                        tabWidth,

+ 2 - 2
Terminal.Gui/Views/Button.cs

@@ -37,8 +37,8 @@ public class Button : View
     /// <remarks>The width of the <see cref="Button"/> is computed based on the text length. The height will always be 1.</remarks>
     public Button ()
     {
-        TextAlignment = Alignment.Centered;
-        VerticalTextAlignment = Alignment.Centered;
+        TextAlignment = Alignment.Center;
+        VerticalTextAlignment = Alignment.Center;
 
         _leftBracket = Glyphs.LeftBracket;
         _rightBracket = Glyphs.RightBracket;

+ 4 - 4
Terminal.Gui/Views/CheckBox.cs

@@ -155,13 +155,13 @@ public class CheckBox : View
     {
         switch (TextAlignment)
         {
-            case Alignment.Left:
-            case Alignment.Centered:
-            case Alignment.Justified:
+            case Alignment.Start:
+            case Alignment.Center:
+            case Alignment.Fill:
                 TextFormatter.Text = $"{GetCheckedState ()} {Text}";
 
                 break;
-            case Alignment.Right:
+            case Alignment.End:
                 TextFormatter.Text = $"{Text} {GetCheckedState ()}";
 
                 break;

+ 1 - 1
Terminal.Gui/Views/Dialog.cs

@@ -122,7 +122,7 @@ public class Dialog : Window
     /// <remarks>This property can be set in a Theme.</remarks>
     [SerializableConfigurationProperty (Scope = typeof (ThemeScope))]
     [JsonConverter (typeof (JsonStringEnumConverter))]
-    public static Alignment DefaultButtonAlignment { get; set; } = Alignment.Right;
+    public static Alignment DefaultButtonAlignment { get; set; } = Alignment.End;
 
     /// <summary>
     ///     Adds a <see cref="Button"/> to the <see cref="Dialog"/>, its layout will be controlled by the

+ 1 - 1
Terminal.Gui/Views/ListView.cs

@@ -1002,7 +1002,7 @@ public class ListWrapper : IListDataSource
     private void RenderUstr (ConsoleDriver driver, string ustr, int col, int line, int width, int start = 0)
     {
         string str = start > ustr.GetColumns () ? string.Empty : ustr.Substring (Math.Min (start, ustr.ToRunes ().Length - 1));
-        string u = TextFormatter.ClipAndJustify (str, width, Alignment.Left);
+        string u = TextFormatter.ClipAndJustify (str, width, Alignment.Start);
         driver.AddStr (u);
         width -= u.GetColumns ();
 

+ 1 - 1
Terminal.Gui/Views/Menu/Menu.cs

@@ -890,7 +890,7 @@ internal sealed class Menu : View
                     var tf = new TextFormatter
                     {
                         AutoSize = true,
-                        Alignment = Alignment.Centered, HotKeySpecifier = MenuBar.HotKeySpecifier, Text = textToDraw
+                        Alignment = Alignment.Center, HotKeySpecifier = MenuBar.HotKeySpecifier, Text = textToDraw
                     };
 
                     // The -3 is left/right border + one space (not sure what for)

+ 2 - 2
Terminal.Gui/Views/MessageBox.cs

@@ -341,7 +341,7 @@ public static class MessageBox
         }
 
         Alignment buttonJust = Dialog.DefaultButtonAlignment;
-        Dialog.DefaultButtonAlignment = Alignment.Centered;
+        Dialog.DefaultButtonAlignment = Alignment.Center;
         var d = new Dialog
         {
             Buttons = buttonList.ToArray (),
@@ -374,7 +374,7 @@ public static class MessageBox
         var messageLabel = new Label
         {
             Text = message,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             X = Pos.Center (),
             Y = 0,
            // ColorScheme = Colors.ColorSchemes ["Error"]

+ 1 - 1
Terminal.Gui/Views/ProgressBar.cs

@@ -175,7 +175,7 @@ public class ProgressBar : View
 
         if (ProgressBarFormat != ProgressBarFormat.Simple && !_isActivity)
         {
-            var tf = new TextFormatter { Alignment = Alignment.Centered, Text = Text, AutoSize = true };
+            var tf = new TextFormatter { Alignment = Alignment.Center, Text = Text, AutoSize = true };
             var attr = new Attribute (ColorScheme.HotNormal.Foreground, ColorScheme.HotNormal.Background);
 
             if (_fraction > .5)

+ 6 - 12
Terminal.Gui/Views/Slider.cs

@@ -816,18 +816,18 @@ public class Slider<T> : View
         // Note: The formatter doesn't handle all of this ???
         switch (alignment)
         {
-            case Alignment.Justified:
+            case Alignment.Fill:
                 return TextFormatter.Justify (text, width);
-            case Alignment.Left:
+            case Alignment.Start:
                 return text + s1 + s1 + s2;
-            case Alignment.Centered:
+            case Alignment.Center:
                 if (text.Length % 2 != 0)
                 {
                     return s1 + text + s1 + s2;
                 }
 
                 return s1 + s2 + text + s1;
-            case Alignment.Right:
+            case Alignment.End:
                 return s1 + s1 + s2 + text;
             default:
                 return text;
@@ -934,12 +934,6 @@ public class Slider<T> : View
                             }
 
                             break;
-                        case SliderType.Single:
-                            break;
-                        case SliderType.Multiple:
-                            break;
-                        default:
-                            throw new ArgumentOutOfRangeException ();
                     }
                 }
 
@@ -1160,7 +1154,7 @@ public class Slider<T> : View
                     switch (_config._legendsOrientation)
                     {
                         case Orientation.Horizontal:
-                            text = AlignText (text, _config._cachedInnerSpacing + 1, Alignment.Centered);
+                            text = AlignText (text, _config._cachedInnerSpacing + 1, Alignment.Center);
 
                             break;
                         case Orientation.Vertical:
@@ -1178,7 +1172,7 @@ public class Slider<T> : View
 
                             break;
                         case Orientation.Vertical:
-                            text = AlignText (text, _config._cachedInnerSpacing + 1, Alignment.Centered);
+                            text = AlignText (text, _config._cachedInnerSpacing + 1, Alignment.Center);
 
                             break;
                     }

+ 5 - 5
Terminal.Gui/Views/TableView/TableView.cs

@@ -2116,16 +2116,16 @@ public class TableView : View
                         - (representation.EnumerateRunes ().Sum (c => c.GetColumns ())
                            + 1 /*leave 1 space for cell boundary*/);
 
-            switch (colStyle?.GetAlignment (originalCellValue) ?? Alignment.Left)
+            switch (colStyle?.GetAlignment (originalCellValue) ?? Alignment.Start)
             {
-                case Alignment.Left:
+                case Alignment.Start:
                     return representation + new string (' ', toPad);
-                case Alignment.Right:
+                case Alignment.End:
                     return new string (' ', toPad) + representation;
 
                 // TODO: With single line cells, centered and justified are the same right?
-                case Alignment.Centered:
-                case Alignment.Justified:
+                case Alignment.Center:
+                case Alignment.Fill:
                     return
                         new string (' ', (int)Math.Floor (toPad / 2.0))
                         + // round down

+ 7 - 7
Terminal.Gui/Views/TextValidateField.cs

@@ -539,7 +539,7 @@ namespace Terminal.Gui
             {
                 int c = _provider.Cursor (mouseEvent.Position.X - GetMargins (Viewport.Width).left);
 
-                if (_provider.Fixed == false && TextAlignment == Alignment.Right && Text.Length > 0)
+                if (_provider.Fixed == false && TextAlignment == Alignment.End && Text.Length > 0)
                 {
                     c++;
                 }
@@ -633,7 +633,7 @@ namespace Terminal.Gui
             // When it's right-aligned and it's a normal input, the cursor behaves differently.
             int curPos;
 
-            if (_provider?.Fixed == false && TextAlignment == Alignment.Right)
+            if (_provider?.Fixed == false && TextAlignment == Alignment.End)
             {
                 curPos = _cursorPosition + left - 1;
             }
@@ -650,7 +650,7 @@ namespace Terminal.Gui
         /// <returns></returns>
         private bool BackspaceKeyHandler ()
         {
-            if (_provider.Fixed == false && TextAlignment == Alignment.Right && _cursorPosition <= 1)
+            if (_provider.Fixed == false && TextAlignment == Alignment.End && _cursorPosition <= 1)
             {
                 return false;
             }
@@ -688,7 +688,7 @@ namespace Terminal.Gui
         /// <returns></returns>
         private bool DeleteKeyHandler ()
         {
-            if (_provider.Fixed == false && TextAlignment == Alignment.Right)
+            if (_provider.Fixed == false && TextAlignment == Alignment.End)
             {
                 _cursorPosition = _provider.CursorLeft (_cursorPosition);
             }
@@ -719,11 +719,11 @@ namespace Terminal.Gui
 
             switch (TextAlignment)
             {
-                case Alignment.Left:
+                case Alignment.Start:
                     return (0, total);
-                case Alignment.Centered:
+                case Alignment.Center:
                     return (total / 2, total / 2 + total % 2);
-                case Alignment.Right:
+                case Alignment.End:
                     return (total, 0);
                 default:
                     return (0, total);

+ 1 - 1
Terminal.Gui/Views/TextView.cs

@@ -1784,7 +1784,7 @@ internal class WordWrapManager
                                                             TextFormatter.Format (
                                                                                   TextModel.ToString (line),
                                                                                   width,
-                                                                                  Alignment.Left,
+                                                                                  Alignment.Start,
                                                                                   true,
                                                                                   preserveTrailingSpaces,
                                                                                   tabWidth

+ 1 - 1
Terminal.Gui/Views/Wizard/Wizard.cs

@@ -67,7 +67,7 @@ public class Wizard : Dialog
     public Wizard ()
     {
         // TODO: LastRightRestLeft will enable a "Quit" button to always appear at the far left
-        ButtonAlignment = Alignment.LastRightRestLeft;
+        ButtonAlignment = Alignment.LastEndRestStart;
         BorderStyle = LineStyle.Double;
 
         //// Add a horiz separator

+ 2 - 2
UICatalog/Scenarios/BasicColors.cs

@@ -32,7 +32,7 @@ public class BasicColors : Scenario
                 Y = 0,
                 Width = 1,
                 Height = 13,
-                VerticalTextAlignment = Alignment.Bottom,
+                VerticalTextAlignment = Alignment.End,
                 ColorScheme = new ColorScheme { Normal = attr },
                 Text = bg.ToString (),
                 TextDirection = TextDirection.TopBottom_LeftRight
@@ -45,7 +45,7 @@ public class BasicColors : Scenario
                 Y = y,
                 Width = 13,
                 Height = 1,
-                TextAlignment = Alignment.Right,
+                TextAlignment = Alignment.End,
                 ColorScheme = new ColorScheme { Normal = attr },
                 Text = bg.ToString ()
             };

+ 25 - 25
UICatalog/Scenarios/Buttons.cs

@@ -287,39 +287,39 @@ public class Buttons : Scenario
                                               switch (args.SelectedItem)
                                               {
                                                   case 0:
-                                                      moveBtn.TextAlignment = Alignment.Left;
-                                                      sizeBtn.TextAlignment = Alignment.Left;
-                                                      moveBtnA.TextAlignment = Alignment.Left;
-                                                      sizeBtnA.TextAlignment = Alignment.Left;
-                                                      moveHotKeyBtn.TextAlignment = Alignment.Left;
-                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Left;
+                                                      moveBtn.TextAlignment = Alignment.Start;
+                                                      sizeBtn.TextAlignment = Alignment.Start;
+                                                      moveBtnA.TextAlignment = Alignment.Start;
+                                                      sizeBtnA.TextAlignment = Alignment.Start;
+                                                      moveHotKeyBtn.TextAlignment = Alignment.Start;
+                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Start;
 
                                                       break;
                                                   case 1:
-                                                      moveBtn.TextAlignment = Alignment.Right;
-                                                      sizeBtn.TextAlignment = Alignment.Right;
-                                                      moveBtnA.TextAlignment = Alignment.Right;
-                                                      sizeBtnA.TextAlignment = Alignment.Right;
-                                                      moveHotKeyBtn.TextAlignment = Alignment.Right;
-                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Right;
+                                                      moveBtn.TextAlignment = Alignment.End;
+                                                      sizeBtn.TextAlignment = Alignment.End;
+                                                      moveBtnA.TextAlignment = Alignment.End;
+                                                      sizeBtnA.TextAlignment = Alignment.End;
+                                                      moveHotKeyBtn.TextAlignment = Alignment.End;
+                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.End;
 
                                                       break;
                                                   case 2:
-                                                      moveBtn.TextAlignment = Alignment.Centered;
-                                                      sizeBtn.TextAlignment = Alignment.Centered;
-                                                      moveBtnA.TextAlignment = Alignment.Centered;
-                                                      sizeBtnA.TextAlignment = Alignment.Centered;
-                                                      moveHotKeyBtn.TextAlignment = Alignment.Centered;
-                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Centered;
+                                                      moveBtn.TextAlignment = Alignment.Center;
+                                                      sizeBtn.TextAlignment = Alignment.Center;
+                                                      moveBtnA.TextAlignment = Alignment.Center;
+                                                      sizeBtnA.TextAlignment = Alignment.Center;
+                                                      moveHotKeyBtn.TextAlignment = Alignment.Center;
+                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Center;
 
                                                       break;
                                                   case 3:
-                                                      moveBtn.TextAlignment = Alignment.Justified;
-                                                      sizeBtn.TextAlignment = Alignment.Justified;
-                                                      moveBtnA.TextAlignment = Alignment.Justified;
-                                                      sizeBtnA.TextAlignment = Alignment.Justified;
-                                                      moveHotKeyBtn.TextAlignment = Alignment.Justified;
-                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Justified;
+                                                      moveBtn.TextAlignment = Alignment.Fill;
+                                                      sizeBtn.TextAlignment = Alignment.Fill;
+                                                      moveBtnA.TextAlignment = Alignment.Fill;
+                                                      sizeBtnA.TextAlignment = Alignment.Fill;
+                                                      moveHotKeyBtn.TextAlignment = Alignment.Fill;
+                                                      moveUnicodeHotKeyBtn.TextAlignment = Alignment.Fill;
 
                                                       break;
                                               }
@@ -439,7 +439,7 @@ public class Buttons : Scenario
                 Y = Pos.Top (_down),
                 Width = Dim.Func (() => Digits),
                 Height = 1,
-                TextAlignment = Alignment.Centered,
+                TextAlignment = Alignment.Center,
                 CanFocus = true
             };
 

+ 1 - 1
UICatalog/Scenarios/CharacterMap.cs

@@ -958,7 +958,7 @@ internal class CharMap : View
             Y = 1,
             Width = Dim.Fill (),
             Height = Dim.Fill (1),
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
         var spinner = new SpinnerView { X = Pos.Center (), Y = Pos.Center (), Style = new Aesthetic () };
         spinner.AutoSpin = true;

+ 2 - 2
UICatalog/Scenarios/CollectionNavigatorTester.cs

@@ -142,7 +142,7 @@ public class CollectionNavigatorTester : Scenario
         var label = new Label
         {
             Text = "ListView",
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             X = 0,
             Y = 1, // for menu
             Width = Dim.Percent (50),
@@ -171,7 +171,7 @@ public class CollectionNavigatorTester : Scenario
         var label = new Label
         {
             Text = "TreeView",
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             X = Pos.Right (_listView) + 2,
             Y = 1, // for menu
             Width = Dim.Percent (50),

+ 2 - 2
UICatalog/Scenarios/ColorPicker.cs

@@ -69,8 +69,8 @@ public class ColorPickers : Scenario
         {
             Title = "Color Sample",
             Text = "Lorem Ipsum",
-            TextAlignment = Alignment.Centered,
-            VerticalTextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
+            VerticalTextAlignment = Alignment.Center,
             BorderStyle = LineStyle.Heavy,
             X = Pos.Center (),
             Y = Pos.Center (),

+ 13 - 13
UICatalog/Scenarios/ComputedLayout.cs

@@ -91,7 +91,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Left,
+                           TextAlignment = Alignment.Start,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -103,7 +103,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Right,
+                           TextAlignment = Alignment.End,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -115,7 +115,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Centered,
+                           TextAlignment = Alignment.Center,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -127,7 +127,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Justified,
+                           TextAlignment = Alignment.Fill,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -153,7 +153,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Left,
+                           TextAlignment = Alignment.Start,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -165,7 +165,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Right,
+                           TextAlignment = Alignment.End,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -177,7 +177,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Centered,
+                           TextAlignment = Alignment.Center,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -189,7 +189,7 @@ public class ComputedLayout : Scenario
         labelList.Add (
                        new Label
                        {
-                           TextAlignment = Alignment.Justified,
+                           TextAlignment = Alignment.Fill,
                            Width = Dim.Fill (),
                            X = 0,
                            Y = Pos.Bottom (labelList.LastOrDefault ()),
@@ -324,7 +324,7 @@ public class ComputedLayout : Scenario
         var anchorEndLabel1 = new Label
         {
             Text = "This Label should be the 3rd to last line (AnchorEnd (3)).",
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             ColorScheme = Colors.ColorSchemes ["Menu"],
             Width = Dim.Fill (5),
             X = 5,
@@ -338,7 +338,7 @@ public class ComputedLayout : Scenario
         {
             Text =
                 "This TextField should be the 4th to last line (AnchorEnd (3) - 1).",
-            TextAlignment = Alignment.Left,
+            TextAlignment = Alignment.Start,
             ColorScheme = Colors.ColorSchemes ["Menu"],
             Width = Dim.Fill (5),
             X = 5,
@@ -397,9 +397,9 @@ public class ComputedLayout : Scenario
 
 
         // Center three buttons with 
-        leftButton.X = Pos.Align (Alignment.Centered);
-        centerButton.X = Pos.Align (Alignment.Centered);
-        rightButton.X = Pos.Align (Alignment.Centered);
+        leftButton.X = Pos.Align (Alignment.Center);
+        centerButton.X = Pos.Align (Alignment.Center);
+        rightButton.X = Pos.Align (Alignment.Center);
 
         Application.Run (app);
         app.Dispose ();

+ 10 - 10
UICatalog/Scenarios/CsvEditor.cs

@@ -78,17 +78,17 @@ public class CsvEditor : Scenario
                                      _miLeft = new MenuItem (
                                                              "_Align Left",
                                                              "",
-                                                             () => Align (Alignment.Left)
+                                                             () => Align (Alignment.Start)
                                                             ),
                                      _miRight = new MenuItem (
                                                               "_Align Right",
                                                               "",
-                                                              () => Align (Alignment.Right)
+                                                              () => Align (Alignment.End)
                                                              ),
                                      _miCentered = new MenuItem (
                                                                  "_Align Centered",
                                                                  "",
-                                                                 () => Align (Alignment.Centered)
+                                                                 () => Align (Alignment.Center)
                                                                 ),
 
                                      // Format requires hard typed data table, when we read a CSV everything is untyped (string) so this only works for new columns in this demo
@@ -133,7 +133,7 @@ public class CsvEditor : Scenario
             Y = Pos.Bottom (_tableView),
             Text = "0,0",
             Width = Dim.Fill (),
-            TextAlignment = Alignment.Right
+            TextAlignment = Alignment.End
         };
         _selectedCellLabel.TextChanged += SelectedCellLabel_TextChanged;
 
@@ -228,9 +228,9 @@ public class CsvEditor : Scenario
         ColumnStyle style = _tableView.Style.GetOrCreateColumnStyle (_tableView.SelectedColumn);
         style.Alignment = newAlignment;
 
-        _miLeft.Checked = style.Alignment == Alignment.Left;
-        _miRight.Checked = style.Alignment == Alignment.Right;
-        _miCentered.Checked = style.Alignment == Alignment.Centered;
+        _miLeft.Checked = style.Alignment == Alignment.Start;
+        _miRight.Checked = style.Alignment == Alignment.End;
+        _miCentered.Checked = style.Alignment == Alignment.Center;
 
         _tableView.Update ();
     }
@@ -437,9 +437,9 @@ public class CsvEditor : Scenario
 
         ColumnStyle style = _tableView.Style.GetColumnStyleIfAny (_tableView.SelectedColumn);
 
-        _miLeft.Checked = style?.Alignment == Alignment.Left;
-        _miRight.Checked = style?.Alignment == Alignment.Right;
-        _miCentered.Checked = style?.Alignment == Alignment.Centered;
+        _miLeft.Checked = style?.Alignment == Alignment.Start;
+        _miRight.Checked = style?.Alignment == Alignment.End;
+        _miCentered.Checked = style?.Alignment == Alignment.Center;
     }
 
     private void Open ()

+ 7 - 7
UICatalog/Scenarios/Dialogs.cs

@@ -32,7 +32,7 @@ public class Dialogs : Scenario
         var numButtonsLabel = new Label
         {
             X = 0,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "_Number of Buttons:"
         };
 
@@ -42,7 +42,7 @@ public class Dialogs : Scenario
             Y = 0,
             Width = Dim.Width (numButtonsLabel),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "_Width:"
         };
         frame.Add (label);
@@ -63,7 +63,7 @@ public class Dialogs : Scenario
             Y = Pos.Bottom (label),
             Width = Dim.Width (numButtonsLabel),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "_Height:"
         };
         frame.Add (label);
@@ -97,7 +97,7 @@ public class Dialogs : Scenario
             Y = Pos.Bottom (label),
             Width = Dim.Width (numButtonsLabel),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "_Title:"
         };
         frame.Add (label);
@@ -129,7 +129,7 @@ public class Dialogs : Scenario
         {
             X = Pos.Right (numButtonsLabel) + 1,
             Y = Pos.Bottom (numButtonsLabel),
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = $"_Add {char.ConvertFromUtf32 (CODE_POINT)} to button text to stress wide char support",
             Checked = false
         };
@@ -141,7 +141,7 @@ public class Dialogs : Scenario
             Y = Pos.Bottom (glyphsNotWords),
             Width = Dim.Width (numButtonsLabel),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Button A_lignment:"
         };
         frame.Add (label);
@@ -162,7 +162,7 @@ public class Dialogs : Scenario
 
         label = new ()
         {
-            X = Pos.Center (), Y = Pos.Bottom (frame) + 4, TextAlignment = Alignment.Right, Text = "Button Pressed:"
+            X = Pos.Center (), Y = Pos.Bottom (frame) + 4, TextAlignment = Alignment.End, Text = "Button Pressed:"
         };
         app.Add (label);
 

+ 2 - 2
UICatalog/Scenarios/DynamicMenuBar.cs

@@ -623,7 +623,7 @@ public class DynamicMenuBar : Scenario
             var _lblMenuBar = new Label
             {
                 ColorScheme = Colors.ColorSchemes ["Dialog"],
-                TextAlignment = Alignment.Centered,
+                TextAlignment = Alignment.Center,
                 X = Pos.Right (_btnPrevious) + 1,
                 Y = Pos.Top (_btnPrevious),
 
@@ -636,7 +636,7 @@ public class DynamicMenuBar : Scenario
 
             var _lblParent = new Label
             {
-                TextAlignment = Alignment.Centered,
+                TextAlignment = Alignment.Center,
                 X = Pos.Right (_btnPrevious) + 1,
                 Y = Pos.Top (_btnPrevious) + 1,
 

+ 9 - 9
UICatalog/Scenarios/Editor.cs

@@ -882,7 +882,7 @@ public class Editor : Scenario
         {
             Y = 1,
             Width = lblWidth,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
 
             Text = "Find:"
         };
@@ -903,7 +903,7 @@ public class Editor : Scenario
             Y = Pos.Top (label),
             Width = 20,
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             IsDefault = true,
 
             Text = "Find _Next"
@@ -917,7 +917,7 @@ public class Editor : Scenario
             Y = Pos.Top (btnFindNext) + 1,
             Width = 20,
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Text = "Find _Previous"
         };
@@ -937,7 +937,7 @@ public class Editor : Scenario
             X = Pos.Right (txtToFind) + 1,
             Y = Pos.Top (btnFindPrevious) + 2,
             Width = 20,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Text = "Cancel"
         };
@@ -1134,7 +1134,7 @@ public class Editor : Scenario
         {
             Y = 1,
             Width = lblWidth,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
 
             Text = "Find:"
         };
@@ -1155,7 +1155,7 @@ public class Editor : Scenario
             Y = Pos.Top (label),
             Width = 20,
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             IsDefault = true,
 
             Text = "Replace _Next"
@@ -1181,7 +1181,7 @@ public class Editor : Scenario
             Y = Pos.Top (btnFindNext) + 1,
             Width = 20,
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Text = "Replace _Previous"
         };
@@ -1194,7 +1194,7 @@ public class Editor : Scenario
             Y = Pos.Top (btnFindPrevious) + 1,
             Width = 20,
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Text = "Replace _All"
         };
@@ -1215,7 +1215,7 @@ public class Editor : Scenario
             X = Pos.Right (txtToFind) + 1,
             Y = Pos.Top (btnReplaceAll) + 1,
             Width = 20,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Text = "Cancel"
         };

+ 1 - 1
UICatalog/Scenarios/ListColumns.cs

@@ -247,7 +247,7 @@ public class ListColumns : Scenario
             Text = "0,0",
 
             Width = Dim.Fill (),
-            TextAlignment = Alignment.Right
+            TextAlignment = Alignment.End
         };
 
         Win.Add (selectedCellLabel);

+ 9 - 9
UICatalog/Scenarios/MessageBoxes.cs

@@ -30,7 +30,7 @@ public class MessageBoxes : Scenario
         app.Add (frame);
 
         // TODO: Use Pos.Align her to demo aligning labels and fields
-        var label = new Label { X = 0, Y = 0, Width = 15, TextAlignment = Alignment.Right, Text = "Width:" };
+        var label = new Label { X = 0, Y = 0, Width = 15, TextAlignment = Alignment.End, Text = "Width:" };
         frame.Add (label);
 
         var widthEdit = new TextField
@@ -50,7 +50,7 @@ public class MessageBoxes : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Height:"
         };
         frame.Add (label);
@@ -85,7 +85,7 @@ public class MessageBoxes : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Title:"
         };
         frame.Add (label);
@@ -107,7 +107,7 @@ public class MessageBoxes : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Message:"
         };
         frame.Add (label);
@@ -129,7 +129,7 @@ public class MessageBoxes : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Num Buttons:"
         };
         frame.Add (label);
@@ -151,7 +151,7 @@ public class MessageBoxes : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Default Button:"
         };
         frame.Add (label);
@@ -173,7 +173,7 @@ public class MessageBoxes : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Style:"
         };
         frame.Add (label);
@@ -194,7 +194,7 @@ public class MessageBoxes : Scenario
 
         label = new ()
         {
-            X = Pos.Center (), Y = Pos.Bottom (frame) + 2, TextAlignment = Alignment.Right, Text = "Button Pressed:"
+            X = Pos.Center (), Y = Pos.Bottom (frame) + 2, TextAlignment = Alignment.End, Text = "Button Pressed:"
         };
         app.Add (label);
 
@@ -203,7 +203,7 @@ public class MessageBoxes : Scenario
             X = Pos.Center (),
             Y = Pos.Bottom (label) + 1,
             ColorScheme = Colors.ColorSchemes ["Error"],
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Text = " "
         };
 

+ 2 - 2
UICatalog/Scenarios/Mouse.cs

@@ -100,8 +100,8 @@ public class Mouse : Scenario
             Width = 20,
             Height = 3,
             Text = "Enter/Leave Demo",
-            TextAlignment = Alignment.Centered,
-            VerticalTextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
+            VerticalTextAlignment = Alignment.Center,
             ColorScheme = Colors.ColorSchemes ["Dialog"]
         };
         win.Add (demo);

+ 4 - 4
UICatalog/Scenarios/PosAlignDemo.cs

@@ -47,7 +47,7 @@ public sealed class PosAlignDemo : Scenario
         {
             X = Pos.Align (_horizAligner.Alignment),
             Y = Pos.Center (),
-            RadioLabels = new [] { "Left", "Right", "Centered", "Justified", "FirstLeftRestRight", "LastRightRestLeft" },
+            RadioLabels = new [] { "Start", "End", "Center", "Fill", "FirstLeftRestRight", "LastRightRestLeft" },
             ColorScheme = colorScheme
         };
 
@@ -192,7 +192,7 @@ public sealed class PosAlignDemo : Scenario
         {
             X = 0,
             Y = Pos.Align (_vertAligner.Alignment),
-            RadioLabels = new [] { "Top", "Bottom", "Centered", "Justified", "FirstTopRestBottom", "LastBottomRestTop" },
+            RadioLabels = new [] { "Start", "End", "Center", "Fill", "FirstStartRestEnd", "LastEndRestStart" },
             ColorScheme = colorScheme
         };
 
@@ -358,8 +358,8 @@ public sealed class PosAlignDemo : Scenario
                 Width = 5
             };
 
-            v.X = Pos.Align (Alignment.Right, i / 3);
-            v.Y = Pos.Align (Alignment.Justified, i % 3 + 10);
+            v.X = Pos.Align (Alignment.End, i / 3);
+            v.Y = Pos.Align (Alignment.Fill, i % 3 + 10);
 
             container.Add (v);
         }

+ 9 - 9
UICatalog/Scenarios/ProgressBarStyles.cs

@@ -50,7 +50,7 @@ public class ProgressBarStyles : Scenario
         var pbList = new ListView
         {
             Title = "Focused ProgressBar",
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             X = Pos.Center (),
             Width = Dim.Auto (),
             Height = Dim.Auto (),
@@ -98,7 +98,7 @@ public class ProgressBarStyles : Scenario
         {
             Text = "Foreground HotNormal Color",
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
         };
         container.Add (fgColorPickerBtn);
 
@@ -124,7 +124,7 @@ public class ProgressBarStyles : Scenario
         var bgColorPickerBtn = new Button
         {
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             Text = "Background HotNormal Color"
         };
         container.Add (bgColorPickerBtn);
@@ -158,7 +158,7 @@ public class ProgressBarStyles : Scenario
             BorderStyle = LineStyle.Single,
             Title = "ProgressBarFormat",
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             RadioLabels = pbFormatEnum.Select (e => e.ToString ()).ToArray ()
         };
         container.Add (rbPBFormat);
@@ -166,7 +166,7 @@ public class ProgressBarStyles : Scenario
         var button = new Button
         {
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             Text = "Start timer"
         };
         container.Add (button);
@@ -175,7 +175,7 @@ public class ProgressBarStyles : Scenario
         {
             Title = "Blocks",
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             Width = Dim.Percent (50),
             BorderStyle = LineStyle.Single,
             CanFocus = true
@@ -188,7 +188,7 @@ public class ProgressBarStyles : Scenario
         {
             Title = "Continuous",
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             Width = Dim.Percent (50),
             ProgressBarStyle = ProgressBarStyle.Continuous,
             BorderStyle = LineStyle.Single,
@@ -238,7 +238,7 @@ public class ProgressBarStyles : Scenario
         {
             Title = "Marquee Blocks",
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             Width = Dim.Percent (50),
             ProgressBarStyle = ProgressBarStyle.MarqueeBlocks,
             BorderStyle = LineStyle.Single,
@@ -250,7 +250,7 @@ public class ProgressBarStyles : Scenario
         {
             Title = "Marquee Continuous",
             X = Pos.Center (),
-            Y = Pos.Align (Alignment.Top),
+            Y = Pos.Align (Alignment.Start),
             Width = Dim.Percent (50),
             ProgressBarStyle = ProgressBarStyle.MarqueeContinuous,
             BorderStyle = LineStyle.Single,

+ 7 - 7
UICatalog/Scenarios/TableEditor.cs

@@ -707,7 +707,7 @@ public class TableEditor : Scenario
             Text = "0,0",
 
             Width = Dim.Fill (),
-            TextAlignment = Alignment.Right
+            TextAlignment = Alignment.End
         };
 
         Win.Add (selectedCellLabel);
@@ -1107,12 +1107,12 @@ public class TableEditor : Scenario
     {
         _tableView.Style.ColumnStyles.Clear ();
 
-        var alignMid = new ColumnStyle { Alignment = Alignment.Centered };
-        var alignRight = new ColumnStyle { Alignment = Alignment.Right };
+        var alignMid = new ColumnStyle { Alignment = Alignment.Center };
+        var alignRight = new ColumnStyle { Alignment = Alignment.End };
 
         var dateFormatStyle = new ColumnStyle
         {
-            Alignment = Alignment.Right,
+            Alignment = Alignment.End,
             RepresentationGetter = v =>
                                        v is DateTime d ? d.ToString ("yyyy-MM-dd") : v.ToString ()
         };
@@ -1126,15 +1126,15 @@ public class TableEditor : Scenario
 
                                        // align negative values right
                                        d < 0
-                                           ? Alignment.Right
+                                           ? Alignment.End
                                            :
 
                                            // align positive values left
-                                           Alignment.Left
+                                           Alignment.Start
                                        :
 
                                        // not a double
-                                       Alignment.Left,
+                                       Alignment.Start,
             ColorGetter = a => a.CellValue is double d
                                    ?
 

+ 1 - 1
UICatalog/Scenarios/Text.cs

@@ -290,7 +290,7 @@ public class Text : Scenario
             X = Pos.Right (regexProvider) + 1,
             Y = Pos.Y (regexProvider),
             Width = 30,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Provider = provider2
         };
         Win.Add (regexProviderField);

+ 42 - 42
UICatalog/Scenarios/TextAlignmentAndDirection.cs

@@ -35,7 +35,7 @@ public class TextAlignmentAndDirection : Scenario
             Y = 1,
             Width = 9,
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             ColorScheme = Colors.ColorSchemes ["Dialog"],
             Text = "Left"
         };
@@ -46,7 +46,7 @@ public class TextAlignmentAndDirection : Scenario
             Y = 2,
             Width = 9,
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             ColorScheme = Colors.ColorSchemes ["Dialog"],
             Text = "Centered"
         };
@@ -57,7 +57,7 @@ public class TextAlignmentAndDirection : Scenario
             Y = 3,
             Width = 9,
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             ColorScheme = Colors.ColorSchemes ["Dialog"],
             Text = "Right"
         };
@@ -68,7 +68,7 @@ public class TextAlignmentAndDirection : Scenario
             Y = 4,
             Width = 9,
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             ColorScheme = Colors.ColorSchemes ["Dialog"],
             Text = "Justified"
         };
@@ -80,7 +80,7 @@ public class TextAlignmentAndDirection : Scenario
             Width = Dim.Fill (1) - 9,
             Height = 1,
             ColorScheme = color1,
-            TextAlignment = Alignment.Left,
+            TextAlignment = Alignment.Start,
             Text = txt
         };
 
@@ -91,7 +91,7 @@ public class TextAlignmentAndDirection : Scenario
             Width = Dim.Fill (1) - 9,
             Height = 1,
             ColorScheme = color2,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Text = txt
         };
 
@@ -102,7 +102,7 @@ public class TextAlignmentAndDirection : Scenario
             Width = Dim.Fill (1) - 9,
             Height = 1,
             ColorScheme = color1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = txt
         };
 
@@ -113,7 +113,7 @@ public class TextAlignmentAndDirection : Scenario
             Width = Dim.Fill (1) - 9,
             Height = 1,
             ColorScheme = color2,
-            TextAlignment = Alignment.Justified,
+            TextAlignment = Alignment.Fill,
             Text = txt
         };
 
@@ -141,7 +141,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = 9,
             ColorScheme = color1,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Bottom,
+            VerticalTextAlignment = Alignment.End,
             Text = "Top"
         };
         labelVT.TextFormatter.WordWrap = false;
@@ -154,7 +154,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = 9,
             ColorScheme = color1,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Bottom,
+            VerticalTextAlignment = Alignment.End,
             Text = "Centered"
         };
         labelVM.TextFormatter.WordWrap = false;
@@ -167,7 +167,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = 9,
             ColorScheme = color1,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Bottom,
+            VerticalTextAlignment = Alignment.End,
             Text = "Bottom"
         };
         labelVB.TextFormatter.WordWrap = false;
@@ -180,7 +180,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = 9,
             ColorScheme = color1,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Bottom,
+            VerticalTextAlignment = Alignment.End,
             Text = "Justified"
         };
         labelVJ.TextFormatter.WordWrap = false;
@@ -193,7 +193,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = Dim.Fill (1),
             ColorScheme = color1,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Top,
+            VerticalTextAlignment = Alignment.Start,
             Text = txt
         };
         txtLabelVT.TextFormatter.WordWrap = false;
@@ -206,7 +206,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = Dim.Fill (1),
             ColorScheme = color2,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Centered,
+            VerticalTextAlignment = Alignment.Center,
             Text = txt
         };
         txtLabelVM.TextFormatter.WordWrap = false;
@@ -219,7 +219,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = Dim.Fill (1),
             ColorScheme = color1,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Bottom,
+            VerticalTextAlignment = Alignment.End,
             Text = txt
         };
         txtLabelVB.TextFormatter.WordWrap = false;
@@ -232,7 +232,7 @@ public class TextAlignmentAndDirection : Scenario
             Height = Dim.Fill (1),
             ColorScheme = color2,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Justified,
+            VerticalTextAlignment = Alignment.Fill,
             Text = txt
         };
         txtLabelVJ.TextFormatter.WordWrap = false;
@@ -268,8 +268,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = 1,
             Width = Dim.Percent (100 / 3),
             Height = Dim.Percent (100 / 3),
-            TextAlignment = Alignment.Left,
-            VerticalTextAlignment = Alignment.Top,
+            TextAlignment = Alignment.Start,
+            VerticalTextAlignment = Alignment.Start,
             ColorScheme = color1,
             Text = txt
         };
@@ -281,8 +281,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = 1,
             Width = Dim.Percent (33),
             Height = Dim.Percent (33),
-            TextAlignment = Alignment.Centered,
-            VerticalTextAlignment = Alignment.Top,
+            TextAlignment = Alignment.Center,
+            VerticalTextAlignment = Alignment.Start,
             ColorScheme = color1,
             Text = txt
         };
@@ -294,8 +294,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = 1,
             Width = Dim.Percent (100, DimPercentMode.Position),
             Height = Dim.Percent (33),
-            TextAlignment = Alignment.Right,
-            VerticalTextAlignment = Alignment.Top,
+            TextAlignment = Alignment.End,
+            VerticalTextAlignment = Alignment.Start,
             ColorScheme = color1,
             Text = txt
         };
@@ -307,8 +307,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = Pos.Bottom (txtLabelTL) + 1,
             Width = Dim.Width (txtLabelTL),
             Height = Dim.Percent (33),
-            TextAlignment = Alignment.Left,
-            VerticalTextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Start,
+            VerticalTextAlignment = Alignment.Center,
             ColorScheme = color1,
             Text = txt
         };
@@ -320,8 +320,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = Pos.Bottom (txtLabelTC) + 1,
             Width = Dim.Width (txtLabelTC),
             Height = Dim.Percent (33),
-            TextAlignment = Alignment.Centered,
-            VerticalTextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
+            VerticalTextAlignment = Alignment.Center,
             ColorScheme = color1,
             Text = txt
         };
@@ -333,8 +333,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = Pos.Bottom (txtLabelTR) + 1,
             Width = Dim.Percent (100, DimPercentMode.Position),
             Height = Dim.Percent (33),
-            TextAlignment = Alignment.Right,
-            VerticalTextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.End,
+            VerticalTextAlignment = Alignment.Center,
             ColorScheme = color1,
             Text = txt
         };
@@ -346,8 +346,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = Pos.Bottom (txtLabelML) + 1,
             Width = Dim.Width (txtLabelML),
             Height = Dim.Percent (100, DimPercentMode.Position),
-            TextAlignment = Alignment.Left,
-            VerticalTextAlignment = Alignment.Bottom,
+            TextAlignment = Alignment.Start,
+            VerticalTextAlignment = Alignment.End,
             ColorScheme = color1,
             Text = txt
         };
@@ -359,8 +359,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = Pos.Bottom (txtLabelMC) + 1,
             Width = Dim.Width (txtLabelMC),
             Height = Dim.Percent (100, DimPercentMode.Position),
-            TextAlignment = Alignment.Centered,
-            VerticalTextAlignment = Alignment.Bottom,
+            TextAlignment = Alignment.Center,
+            VerticalTextAlignment = Alignment.End,
             ColorScheme = color1,
             Text = txt
         };
@@ -372,8 +372,8 @@ public class TextAlignmentAndDirection : Scenario
             Y = Pos.Bottom (txtLabelMR) + 1,
             Width = Dim.Percent (100, DimPercentMode.Position),
             Height = Dim.Percent (100, DimPercentMode.Position),
-            TextAlignment = Alignment.Right,
-            VerticalTextAlignment = Alignment.Bottom,
+            TextAlignment = Alignment.End,
+            VerticalTextAlignment = Alignment.End,
             ColorScheme = color1,
             Text = txt
         };
@@ -611,16 +611,16 @@ public class TextAlignmentAndDirection : Scenario
                         switch (justifyOptions.SelectedItem)
                         {
                             case 0:
-                                t.VerticalTextAlignment = Alignment.Justified;
+                                t.VerticalTextAlignment = Alignment.Fill;
                                 t.TextAlignment = ((dynamic)t.Data).h;
                                 break;
                             case 1:
                                 t.VerticalTextAlignment = (Alignment)((dynamic)t.Data).v;
-                                t.TextAlignment = Alignment.Justified;
+                                t.TextAlignment = Alignment.Fill;
                                 break;
                             case 2:
-                                t.VerticalTextAlignment = Alignment.Justified;
-                                t.TextAlignment = Alignment.Justified;
+                                t.VerticalTextAlignment = Alignment.Fill;
+                                t.TextAlignment = Alignment.Fill;
                                 break;
                         }
                     }
@@ -629,16 +629,16 @@ public class TextAlignmentAndDirection : Scenario
                         switch (justifyOptions.SelectedItem)
                         {
                             case 0:
-                                t.TextAlignment = Alignment.Justified;
+                                t.TextAlignment = Alignment.Fill;
                                 t.VerticalTextAlignment = ((dynamic)t.Data).v;
                                 break;
                             case 1:
                                 t.TextAlignment = (Alignment)((dynamic)t.Data).h;
-                                t.VerticalTextAlignment = Alignment.Justified;
+                                t.VerticalTextAlignment = Alignment.Fill;
                                 break;
                             case 2:
-                                t.TextAlignment = Alignment.Justified;
-                                t.VerticalTextAlignment = Alignment.Justified;
+                                t.TextAlignment = Alignment.Fill;
+                                t.VerticalTextAlignment = Alignment.Fill;
                                 break;
                         }
                     }

+ 1 - 1
UICatalog/Scenarios/TextFormatterDemo.cs

@@ -75,7 +75,7 @@ public class TextFormatterDemo : Scenario
             }
         }
 
-        List<Alignment> alignments = new () { Alignment.Left, Alignment.Right, Alignment.Centered, Alignment.Justified };
+        List<Alignment> alignments = new () { Alignment.Start, Alignment.End, Alignment.Center, Alignment.Fill };
         Label [] singleLines = new Label [alignments.Count];
         Label [] multipleLines = new Label [alignments.Count];
 

+ 6 - 6
UICatalog/Scenarios/TimeAndDate.cs

@@ -57,7 +57,7 @@ public class TimeAndDate : Scenario
         {
             X = Pos.Center (),
             Y = Pos.Bottom (longDate) + 1,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Width = Dim.Fill (),
             Text = "Old Time: "
@@ -68,7 +68,7 @@ public class TimeAndDate : Scenario
         {
             X = Pos.Center (),
             Y = Pos.Bottom (_lblOldTime) + 1,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Width = Dim.Fill (),
             Text = "New Time: "
@@ -79,7 +79,7 @@ public class TimeAndDate : Scenario
         {
             X = Pos.Center (),
             Y = Pos.Bottom (_lblNewTime) + 1,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Width = Dim.Fill (),
             Text = "Time Format: "
@@ -90,7 +90,7 @@ public class TimeAndDate : Scenario
         {
             X = Pos.Center (),
             Y = Pos.Bottom (_lblTimeFmt) + 2,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Width = Dim.Fill (),
             Text = "Old Date: "
@@ -101,7 +101,7 @@ public class TimeAndDate : Scenario
         {
             X = Pos.Center (),
             Y = Pos.Bottom (_lblOldDate) + 1,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Width = Dim.Fill (),
             Text = "New Date: "
@@ -112,7 +112,7 @@ public class TimeAndDate : Scenario
         {
             X = Pos.Center (),
             Y = Pos.Bottom (_lblNewDate) + 1,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
 
             Width = Dim.Fill (),
             Text = "Date Format: "

+ 1 - 1
UICatalog/Scenarios/Unicode.cs

@@ -132,7 +132,7 @@ public class UnicodeInMenu : Scenario
 
             Width = Dim.Percent (50),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = $"Justify Right - {gitString}"
         };
         Win.Add (checkBox, checkBoxRight);

+ 5 - 5
UICatalog/Scenarios/ViewExperiments.cs

@@ -60,7 +60,7 @@ public class ViewExperiments : Scenario
             Width = 17,
             Title = "Window 1",
             Text = "Window #2",
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
 
         window1.Margin.Thickness = new (0);
@@ -84,7 +84,7 @@ public class ViewExperiments : Scenario
             Width = 37,
             Title = "Window2",
             Text = "Window #2 (Right(window1)+1",
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
 
         //view3.InitializeFrames ();
@@ -109,7 +109,7 @@ public class ViewExperiments : Scenario
             Width = 37,
             Title = "View4",
             Text = "View #4 (Right(window2)+1",
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
 
         //view4.InitializeFrames ();
@@ -134,7 +134,7 @@ public class ViewExperiments : Scenario
             Width = Dim.Fill (),
             Title = "View5",
             Text = "View #5 (Right(view4)+1 Fill",
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
 
         //view5.InitializeFrames ();
@@ -181,7 +181,7 @@ public class ViewExperiments : Scenario
             X = Pos.Center (),
             Y = Pos.Percent (50),
             Width = 30,
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
         label50.Border.Thickness = new (1, 3, 1, 1);
         label50.Height = 5;

+ 4 - 4
UICatalog/Scenarios/Wizards.cs

@@ -21,7 +21,7 @@ public class Wizards : Scenario
         };
         Win.Add (frame);
 
-        var label = new Label { X = 0, Y = 0, TextAlignment = Alignment.Right, Text = "Width:" };
+        var label = new Label { X = 0, Y = 0, TextAlignment = Alignment.End, Text = "Width:" };
         frame.Add (label);
 
         var widthEdit = new TextField
@@ -41,7 +41,7 @@ public class Wizards : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Height:"
         };
         frame.Add (label);
@@ -63,7 +63,7 @@ public class Wizards : Scenario
 
             Width = Dim.Width (label),
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Text = "Title:"
         };
         frame.Add (label);
@@ -88,7 +88,7 @@ public class Wizards : Scenario
 
         label = new()
         {
-            X = Pos.Center (), Y = Pos.AnchorEnd (1), TextAlignment = Alignment.Right, Text = "Action:"
+            X = Pos.Center (), Y = Pos.AnchorEnd (1), TextAlignment = Alignment.End, Text = "Action:"
         };
         Win.Add (label);
 

+ 3 - 3
UnitTests/Configuration/ThemeScopeTests.cs

@@ -29,12 +29,12 @@ public class ThemeScopeTests
     {
         Reset ();
         Assert.NotEmpty (Themes);
-        Assert.Equal (Alignment.Right, Dialog.DefaultButtonAlignment);
+        Assert.Equal (Alignment.End, Dialog.DefaultButtonAlignment);
 
-        Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.Centered;
+        Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.Center;
 
         ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply ();
-        Assert.Equal (Alignment.Centered, Dialog.DefaultButtonAlignment);
+        Assert.Equal (Alignment.Center, Dialog.DefaultButtonAlignment);
         Reset ();
     }
 

+ 2 - 2
UnitTests/Configuration/ThemeTests.cs

@@ -77,14 +77,14 @@ public class ThemeTests
     public void TestSerialize_RoundTrip ()
     {
         var theme = new ThemeScope ();
-        theme ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.Right;
+        theme ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.End;
 
         string json = JsonSerializer.Serialize (theme, _jsonOptions);
 
         var deserialized = JsonSerializer.Deserialize<ThemeScope> (json, _jsonOptions);
 
         Assert.Equal (
-                      Alignment.Right,
+                      Alignment.End,
                       (Alignment)deserialized ["Dialog.DefaultButtonAlignment"].PropertyValue
                      );
         Reset ();

+ 45 - 45
UnitTests/Dialogs/DialogTests.cs

@@ -32,7 +32,7 @@ public class DialogTests
             Title = title,
             Width = width,
             Height = 1,
-            ButtonAlignment = Alignment.Centered,
+            ButtonAlignment = Alignment.Center,
             Buttons = [new Button { Text = btn1Text }]
         };
 
@@ -57,7 +57,7 @@ public class DialogTests
             Title = title,
             Width = width,
             Height = 1,
-            ButtonAlignment = Alignment.Justified,
+            ButtonAlignment = Alignment.Fill,
             Buttons = [new Button { Text = btn1Text }]
         };
 
@@ -82,7 +82,7 @@ public class DialogTests
             Title = title,
             Width = width,
             Height = 1,
-            ButtonAlignment = Alignment.Right,
+            ButtonAlignment = Alignment.End,
             Buttons = [new Button { Text = btn1Text }]
         };
 
@@ -107,7 +107,7 @@ public class DialogTests
             Title = title,
             Width = width,
             Height = 1,
-            ButtonAlignment = Alignment.Left,
+            ButtonAlignment = Alignment.Start,
             Buttons = [new Button { Text = btn1Text }]
         };
 
@@ -155,7 +155,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -172,7 +172,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                       title,
                                                       width,
-                                                      Alignment.Justified,
+                                                      Alignment.Fill,
                                                       new Button { Text = btn1Text },
                                                       new Button { Text = btn2Text },
                                                       new Button { Text = btn3Text },
@@ -189,7 +189,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                       title,
                                                       width,
-                                                      Alignment.Right,
+                                                      Alignment.End,
                                                       new Button { Text = btn1Text },
                                                       new Button { Text = btn2Text },
                                                       new Button { Text = btn3Text },
@@ -206,7 +206,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                       title,
                                                       width,
-                                                      Alignment.Left,
+                                                      Alignment.Start,
                                                       new Button { Text = btn1Text },
                                                       new Button { Text = btn2Text },
                                                       new Button { Text = btn3Text },
@@ -248,7 +248,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                       title,
                                                       width,
-                                                      Alignment.Centered,
+                                                      Alignment.Center,
                                                       new Button { Text = btn1Text },
                                                       new Button { Text = btn2Text },
                                                       new Button { Text = btn3Text },
@@ -266,7 +266,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -283,7 +283,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -299,7 +299,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -340,7 +340,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -357,7 +357,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -374,7 +374,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -391,7 +391,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -434,7 +434,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -451,7 +451,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -468,7 +468,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -485,7 +485,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text },
@@ -517,7 +517,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btnText }
                                                    );
 
@@ -534,7 +534,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -549,7 +549,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -564,7 +564,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -581,7 +581,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -596,7 +596,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -611,7 +611,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -626,7 +626,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -660,7 +660,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text }
@@ -676,7 +676,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text }
@@ -692,7 +692,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text }
@@ -708,7 +708,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text },
                                                     new Button { Text = btn3Text }
@@ -742,7 +742,7 @@ public class DialogTests
         (runstate, Dialog dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text }
                                                    );
@@ -757,7 +757,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Justified,
+                                                    Alignment.Fill,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text }
                                                    );
@@ -772,7 +772,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Right,
+                                                    Alignment.End,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text }
                                                    );
@@ -787,7 +787,7 @@ public class DialogTests
         (runstate, dlg) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Left,
+                                                    Alignment.Start,
                                                     new Button { Text = btn1Text },
                                                     new Button { Text = btn2Text }
                                                    );
@@ -824,7 +824,7 @@ public class DialogTests
         // Default (Center)
         button1 = new Button { Text = btn1Text };
         button2 = new Button { Text = btn2Text };
-        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Centered, button1, button2);
+        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Center, button1, button2);
         button1.Visible = false;
         RunIteration (ref runstate, ref firstIteration);
         buttonRow = $@"{CM.Glyphs.VLine}         {btn2} {CM.Glyphs.VLine}";
@@ -836,7 +836,7 @@ public class DialogTests
         Assert.Equal (width, buttonRow.Length);
         button1 = new Button { Text = btn1Text };
         button2 = new Button { Text = btn2Text };
-        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Justified, button1, button2);
+        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Fill, button1, button2);
         button1.Visible = false;
         RunIteration (ref runstate, ref firstIteration);
         buttonRow = $@"{CM.Glyphs.VLine}          {btn2}{CM.Glyphs.VLine}";
@@ -848,7 +848,7 @@ public class DialogTests
         Assert.Equal (width, buttonRow.Length);
         button1 = new Button { Text = btn1Text };
         button2 = new Button { Text = btn2Text };
-        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Right, button1, button2);
+        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.End, button1, button2);
         button1.Visible = false;
         RunIteration (ref runstate, ref firstIteration);
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -859,7 +859,7 @@ public class DialogTests
         Assert.Equal (width, buttonRow.Length);
         button1 = new Button { Text = btn1Text };
         button2 = new Button { Text = btn2Text };
-        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Left, button1, button2);
+        (runstate, dlg) = RunButtonTestDialog (title, width, Alignment.Start, button1, button2);
         button1.Visible = false;
         RunIteration (ref runstate, ref firstIteration);
         buttonRow = $@"{CM.Glyphs.VLine}        {btn2}  {CM.Glyphs.VLine}";
@@ -889,7 +889,7 @@ public class DialogTests
 
         win.Loaded += (s, a) =>
                       {
-                          Dialog.DefaultButtonAlignment = Alignment.Centered;
+                          Dialog.DefaultButtonAlignment = Alignment.Center;
                           var dlg = new Dialog { Width = 18, Height = 3, Buttons = [new () { Text = "Ok" }] };
 
                           dlg.Loaded += (s, a) =>
@@ -973,7 +973,7 @@ public class DialogTests
         var win = new Window ();
 
         int iterations = -1;
-        Dialog.DefaultButtonAlignment = Alignment.Centered;
+        Dialog.DefaultButtonAlignment = Alignment.Center;
 
         Iteration += (s, a) =>
                      {
@@ -1008,7 +1008,7 @@ public class DialogTests
     public void Dialog_Opened_From_Another_Dialog ()
     {
         ((FakeDriver)Driver).SetBufferSize (30, 10);
-        Dialog.DefaultButtonAlignment = Alignment.Centered;
+        Dialog.DefaultButtonAlignment = Alignment.Center;
 
         var btn1 = new Button { Text = "press me 1" };
         Button btn2 = null;
@@ -1285,7 +1285,7 @@ public class DialogTests
         (runstate, Dialog _) = RunButtonTestDialog (
                                                     title,
                                                     width,
-                                                    Alignment.Centered,
+                                                    Alignment.Center,
                                                     new Button { Text = btnText }
                                                    );
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
@@ -1338,7 +1338,7 @@ public class DialogTests
         int width = buttonRow.Length;
         d.SetBufferSize (buttonRow.Length, 3);
 
-        (runstate, Dialog dlg) = RunButtonTestDialog (title, width, Alignment.Centered, null);
+        (runstate, Dialog dlg) = RunButtonTestDialog (title, width, Alignment.Center, null);
         TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", _output);
 
         End (runstate);

+ 298 - 298
UnitTests/Drawing/AlignerTests.cs

@@ -62,172 +62,172 @@ public class AlignerTests (ITestOutputHelper output)
     }
 
     [Theory]
-    [InlineData (Alignment.Left, new [] { 0 }, 1, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.Left, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
-    [InlineData (Alignment.Left, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 1 }, 2, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 1 }, 3, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.Left, new [] { 1, 1 }, 3, new [] { 0, 2 })]
-    [InlineData (Alignment.Left, new [] { 1, 1 }, 4, new [] { 0, 2 })]
-    [InlineData (Alignment.Left, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 10, new [] { 0, 2, 5 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 11, new [] { 0, 2, 5 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 12, new [] { 0, 2, 5 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 13, new [] { 0, 2, 5 })]
+    [InlineData (Alignment.Start, new [] { 0 }, 1, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.Start, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
+    [InlineData (Alignment.Start, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 1 }, 2, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 1 }, 3, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.Start, new [] { 1, 1 }, 3, new [] { 0, 2 })]
+    [InlineData (Alignment.Start, new [] { 1, 1 }, 4, new [] { 0, 2 })]
+    [InlineData (Alignment.Start, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 10, new [] { 0, 2, 5 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 11, new [] { 0, 2, 5 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 12, new [] { 0, 2, 5 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 13, new [] { 0, 2, 5 })]
     [InlineData (
-                    Alignment.Left,
+                    Alignment.Start,
                     new [] { 1, 2, 3 },
                     5,
                     new [] { 0, 1, 3 })] // 5 is too small to fit the items. The first item is at 0, the items to the right are clipped.
-    [InlineData (Alignment.Left, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
-    [InlineData (Alignment.Left, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.Left, new [] { 10 }, 101, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 10, 20 }, 101, new [] { 0, 11 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30 }, 100, new [] { 0, 11, 32 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30 }, 101, new [] { 0, 11, 32 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
-    [InlineData (Alignment.Right, new [] { 0 }, 1, new [] { 1 })]
-    [InlineData (Alignment.Right, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.Right, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 10, new [] { 2, 4, 7 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 11, new [] { 3, 5, 8 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 12, new [] { 4, 6, 9 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 13, new [] { 5, 7, 10 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 5, new [] { -1, 0, 2 })] // 5 is too small to fit the items. The first item is at -1.
-    [InlineData (Alignment.Right, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30 }, 100, new [] { 38, 49, 70 })]
-    [InlineData (Alignment.Right, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.Right, new [] { 10 }, 101, new [] { 91 })]
-    [InlineData (Alignment.Right, new [] { 10, 20 }, 101, new [] { 70, 81 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30 }, 101, new [] { 39, 50, 71 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
-    [InlineData (Alignment.Centered, new [] { 0 }, 1, new [] { 0 })]
-    [InlineData (Alignment.Centered, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.Centered, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
-    [InlineData (Alignment.Centered, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.Centered, new [] { 1 }, 2, new [] { 0 })]
-    [InlineData (Alignment.Centered, new [] { 1 }, 3, new [] { 1 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1 }, 3, new [] { 0, 2 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1 }, 4, new [] { 0, 2 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 10, new [] { 1, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 11, new [] { 1, 3, 6 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
+    [InlineData (Alignment.Start, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.Start, new [] { 10 }, 101, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 10, 20 }, 101, new [] { 0, 11 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30 }, 100, new [] { 0, 11, 32 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30 }, 101, new [] { 0, 11, 32 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.End, new [] { 0 }, 1, new [] { 1 })]
+    [InlineData (Alignment.End, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.End, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 10, new [] { 2, 4, 7 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 11, new [] { 3, 5, 8 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 12, new [] { 4, 6, 9 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 13, new [] { 5, 7, 10 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 5, new [] { -1, 0, 2 })] // 5 is too small to fit the items. The first item is at -1.
+    [InlineData (Alignment.End, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30 }, 100, new [] { 38, 49, 70 })]
+    [InlineData (Alignment.End, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.End, new [] { 10 }, 101, new [] { 91 })]
+    [InlineData (Alignment.End, new [] { 10, 20 }, 101, new [] { 70, 81 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30 }, 101, new [] { 39, 50, 71 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.Center, new [] { 0 }, 1, new [] { 0 })]
+    [InlineData (Alignment.Center, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.Center, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
+    [InlineData (Alignment.Center, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.Center, new [] { 1 }, 2, new [] { 0 })]
+    [InlineData (Alignment.Center, new [] { 1 }, 3, new [] { 1 })]
+    [InlineData (Alignment.Center, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.Center, new [] { 1, 1 }, 3, new [] { 0, 2 })]
+    [InlineData (Alignment.Center, new [] { 1, 1 }, 4, new [] { 0, 2 })]
+    [InlineData (Alignment.Center, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 10, new [] { 1, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 11, new [] { 1, 3, 6 })]
     [InlineData (
-                    Alignment.Centered,
+                    Alignment.Center,
                     new [] { 1, 2, 3 },
                     5,
                     new [] { 0, 1, 3 })] // 5 is too small to fit the items. The first item is at 0, the items to the right are clipped.
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 9, new [] { 0, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 10, new [] { 0, 4, 7 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 11, new [] { 0, 4, 8 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 12, new [] { 0, 4, 8 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 13, new [] { 1, 5, 9 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 101, new [] { 0, 34, 68 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 102, new [] { 0, 34, 68 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 103, new [] { 1, 35, 69 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 104, new [] { 1, 35, 69 })]
-    [InlineData (Alignment.Centered, new [] { 10 }, 101, new [] { 45 })]
-    [InlineData (Alignment.Centered, new [] { 10, 20 }, 101, new [] { 35, 46 })]
-    [InlineData (Alignment.Centered, new [] { 10, 20, 30 }, 100, new [] { 19, 30, 51 })]
-    [InlineData (Alignment.Centered, new [] { 10, 20, 30 }, 101, new [] { 19, 30, 51 })]
-    [InlineData (Alignment.Centered, new [] { 10, 20, 30, 40 }, 100, new [] { 0, 10, 30, 60 })]
-    [InlineData (Alignment.Centered, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.Centered, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
-    [InlineData (Alignment.Centered, new [] { 3, 4, 5, 6 }, 25, new [] { 2, 6, 11, 17 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30 }, 100, new [] { 0, 30, 70 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30 }, 101, new [] { 0, 31, 71 })]
-    [InlineData (Alignment.Justified, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.Justified, new [] { 11, 17, 23 }, 100, new [] { 0, 36, 77 })]
-    [InlineData (Alignment.Justified, new [] { 1, 2, 3 }, 11, new [] { 0, 4, 8 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20 }, 101, new [] { 0, 81 })]
-    [InlineData (Alignment.Justified, new [] { 10 }, 101, new [] { 0 })]
-    [InlineData (Alignment.Justified, new [] { 3, 3, 3 }, 21, new [] { 0, 9, 18 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5 }, 21, new [] { 0, 8, 16 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 18, new [] { 0, 3, 7, 12 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 19, new [] { 0, 4, 8, 13 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 20, new [] { 0, 4, 9, 14 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 21, new [] { 0, 4, 9, 15 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 22, new [] { 0, 8, 14, 19 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 23, new [] { 0, 8, 15, 20 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 24, new [] { 0, 8, 15, 21 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 25, new [] { 0, 9, 16, 22 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 26, new [] { 0, 9, 17, 23 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 31, new [] { 0, 11, 20, 28 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 0 }, 1, new [] { 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1 }, 2, new [] { 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1 }, 3, new [] { 2 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1 }, 3, new [] { 0, 2 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1 }, 4, new [] { 0, 3 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 8, new [] { 0, 2, 5 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 9, new [] { 0, 2, 6 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 10, new [] { 0, 2, 7 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 11, new [] { 0, 2, 8 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 5, new [] { -1, 0, 2 })] // 5 is too small to fit the items. The first item is at -1.})]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 3, 3, 3 }, 21, new [] { 0, 4, 18 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 3, 4, 5 }, 21, new [] { 0, 4, 16 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10 }, 101, new [] { 91 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20 }, 101, new [] { 0, 81 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30 }, 100, new [] { 0, 11, 70 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30 }, 101, new [] { 0, 11, 71 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 0 }, 1, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 0, 0, 0 }, 1, new [] { 0, 0, 1 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1 }, 2, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1 }, 3, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1 }, 3, new [] { 0, 2 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1 }, 4, new [] { 0, 3 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 4 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 8, new [] { 0, 2, 5 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 9, new [] { 0, 3, 6 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 10, new [] { 0, 4, 7 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 11, new [] { 0, 5, 8 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 5, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 7 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3, 4 }, 12, new [] { 0, 1, 4, 8 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 3, 3, 3 }, 21, new [] { 0, 14, 18 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 3, 4, 5 }, 21, new [] { 0, 11, 16 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 67 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10 }, 101, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20 }, 101, new [] { 0, 81 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30 }, 100, new [] { 0, 49, 70 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30 }, 101, new [] { 0, 50, 71 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 10, 30, 61 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 10, 30, 60, 101 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 9, new [] { 0, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 10, new [] { 0, 4, 7 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 11, new [] { 0, 4, 8 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 12, new [] { 0, 4, 8 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 13, new [] { 1, 5, 9 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 101, new [] { 0, 34, 68 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 102, new [] { 0, 34, 68 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 103, new [] { 1, 35, 69 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 104, new [] { 1, 35, 69 })]
+    [InlineData (Alignment.Center, new [] { 10 }, 101, new [] { 45 })]
+    [InlineData (Alignment.Center, new [] { 10, 20 }, 101, new [] { 35, 46 })]
+    [InlineData (Alignment.Center, new [] { 10, 20, 30 }, 100, new [] { 19, 30, 51 })]
+    [InlineData (Alignment.Center, new [] { 10, 20, 30 }, 101, new [] { 19, 30, 51 })]
+    [InlineData (Alignment.Center, new [] { 10, 20, 30, 40 }, 100, new [] { 0, 10, 30, 60 })]
+    [InlineData (Alignment.Center, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.Center, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.Center, new [] { 3, 4, 5, 6 }, 25, new [] { 2, 6, 11, 17 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30 }, 100, new [] { 0, 30, 70 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30 }, 101, new [] { 0, 31, 71 })]
+    [InlineData (Alignment.Fill, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.Fill, new [] { 11, 17, 23 }, 100, new [] { 0, 36, 77 })]
+    [InlineData (Alignment.Fill, new [] { 1, 2, 3 }, 11, new [] { 0, 4, 8 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20 }, 101, new [] { 0, 81 })]
+    [InlineData (Alignment.Fill, new [] { 10 }, 101, new [] { 0 })]
+    [InlineData (Alignment.Fill, new [] { 3, 3, 3 }, 21, new [] { 0, 9, 18 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5 }, 21, new [] { 0, 8, 16 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 18, new [] { 0, 3, 7, 12 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 19, new [] { 0, 4, 8, 13 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 20, new [] { 0, 4, 9, 14 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 21, new [] { 0, 4, 9, 15 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 22, new [] { 0, 8, 14, 19 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 23, new [] { 0, 8, 15, 20 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 24, new [] { 0, 8, 15, 21 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 25, new [] { 0, 9, 16, 22 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 26, new [] { 0, 9, 17, 23 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 31, new [] { 0, 11, 20, 28 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 0 }, 1, new [] { 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1 }, 2, new [] { 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1 }, 3, new [] { 2 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1 }, 3, new [] { 0, 2 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1 }, 4, new [] { 0, 3 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 8, new [] { 0, 2, 5 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 9, new [] { 0, 2, 6 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 10, new [] { 0, 2, 7 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 11, new [] { 0, 2, 8 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 5, new [] { -1, 0, 2 })] // 5 is too small to fit the items. The first item is at -1.})]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 3, 3, 3 }, 21, new [] { 0, 4, 18 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 3, 4, 5 }, 21, new [] { 0, 4, 16 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10 }, 101, new [] { 91 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20 }, 101, new [] { 0, 81 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30 }, 100, new [] { 0, 11, 70 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30 }, 101, new [] { 0, 11, 71 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 0 }, 1, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 0, 0, 0 }, 1, new [] { 0, 0, 1 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1 }, 2, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1 }, 3, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1 }, 3, new [] { 0, 2 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1 }, 4, new [] { 0, 3 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 4 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 8, new [] { 0, 2, 5 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 9, new [] { 0, 3, 6 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 10, new [] { 0, 4, 7 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 11, new [] { 0, 5, 8 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 5, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 7 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3, 4 }, 12, new [] { 0, 1, 4, 8 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 3, 3, 3 }, 21, new [] { 0, 14, 18 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 3, 4, 5 }, 21, new [] { 0, 11, 16 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 67 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10 }, 101, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20 }, 101, new [] { 0, 81 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30 }, 100, new [] { 0, 49, 70 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30 }, 101, new [] { 0, 50, 71 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 10, 30, 61 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 10, 30, 60, 101 })]
     public void Alignment_SpaceBetweenItems (Alignment alignment, int [] sizes, int containerSize, int [] expected)
     {
         int [] positions = new Aligner
@@ -240,154 +240,154 @@ public class AlignerTests (ITestOutputHelper output)
     }
 
     [Theory]
-    [InlineData (Alignment.Left, new [] { 0 }, 1, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 0, 0 }, 1, new [] { 0, 0 })]
-    [InlineData (Alignment.Left, new [] { 0, 0, 0 }, 1, new [] { 0, 0, 0 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 10, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 11, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 12, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3 }, 13, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Left, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.Start, new [] { 0 }, 1, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 0, 0 }, 1, new [] { 0, 0 })]
+    [InlineData (Alignment.Start, new [] { 0, 0, 0 }, 1, new [] { 0, 0, 0 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 10, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 11, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 12, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3 }, 13, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.Start, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 6 })]
     [InlineData (
-                    Alignment.Left,
+                    Alignment.Start,
                     new [] { 1, 2, 3 },
                     5,
                     new [] { 0, 1, 3 })] // 5 is too small to fit the items. The first item is at 0, the items to the right are clipped.
-    [InlineData (Alignment.Left, new [] { 10, 20, 30 }, 100, new [] { 0, 10, 30 })]
-    [InlineData (Alignment.Left, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 66 })]
-    [InlineData (Alignment.Left, new [] { 10 }, 101, new [] { 0 })]
-    [InlineData (Alignment.Left, new [] { 10, 20 }, 101, new [] { 0, 10 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30 }, 101, new [] { 0, 10, 30 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 10, 30, 60 })]
-    [InlineData (Alignment.Left, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 10, 30, 60, 100 })]
-    [InlineData (Alignment.Right, new [] { 0 }, 1, new [] { 1 })]
-    [InlineData (Alignment.Right, new [] { 0, 0 }, 1, new [] { 1, 1 })]
-    [InlineData (Alignment.Right, new [] { 0, 0, 0 }, 1, new [] { 1, 1, 1 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 7, new [] { 1, 2, 4 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 10, new [] { 4, 5, 7 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 11, new [] { 5, 6, 8 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 12, new [] { 6, 7, 9 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 13, new [] { 7, 8, 10 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3 }, 5, new [] { -1, 0, 2 })] // 5 is too small to fit the items. The first item is at -1.
-    [InlineData (Alignment.Right, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Right, new [] { 1, 2, 3, 4 }, 11, new [] { 1, 2, 4, 7 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30 }, 100, new [] { 40, 50, 70 })]
-    [InlineData (Alignment.Right, new [] { 33, 33, 33 }, 100, new [] { 1, 34, 67 })]
-    [InlineData (Alignment.Right, new [] { 10 }, 101, new [] { 91 })]
-    [InlineData (Alignment.Right, new [] { 10, 20 }, 101, new [] { 71, 81 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30 }, 101, new [] { 41, 51, 71 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30, 40 }, 101, new [] { 1, 11, 31, 61 })]
-    [InlineData (Alignment.Right, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 1, 11, 31, 61, 101 })]
-    [InlineData (Alignment.Centered, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.Centered, new [] { 1 }, 2, new [] { 0 })]
-    [InlineData (Alignment.Centered, new [] { 1 }, 3, new [] { 1 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1 }, 3, new [] { 0, 1 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1 }, 4, new [] { 1, 2 })]
-    [InlineData (Alignment.Centered, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 10, new [] { 2, 3, 5 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3 }, 11, new [] { 2, 3, 5 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 9, new [] { 0, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 10, new [] { 0, 3, 6 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 11, new [] { 1, 4, 7 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 12, new [] { 1, 4, 7 })]
-    [InlineData (Alignment.Centered, new [] { 3, 3, 3 }, 13, new [] { 2, 5, 8 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30 }, 100, new [] { 0, 10, 30 })]
+    [InlineData (Alignment.Start, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 66 })]
+    [InlineData (Alignment.Start, new [] { 10 }, 101, new [] { 0 })]
+    [InlineData (Alignment.Start, new [] { 10, 20 }, 101, new [] { 0, 10 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30 }, 101, new [] { 0, 10, 30 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 10, 30, 60 })]
+    [InlineData (Alignment.Start, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 10, 30, 60, 100 })]
+    [InlineData (Alignment.End, new [] { 0 }, 1, new [] { 1 })]
+    [InlineData (Alignment.End, new [] { 0, 0 }, 1, new [] { 1, 1 })]
+    [InlineData (Alignment.End, new [] { 0, 0, 0 }, 1, new [] { 1, 1, 1 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 7, new [] { 1, 2, 4 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 10, new [] { 4, 5, 7 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 11, new [] { 5, 6, 8 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 12, new [] { 6, 7, 9 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 13, new [] { 7, 8, 10 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3 }, 5, new [] { -1, 0, 2 })] // 5 is too small to fit the items. The first item is at -1.
+    [InlineData (Alignment.End, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.End, new [] { 1, 2, 3, 4 }, 11, new [] { 1, 2, 4, 7 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30 }, 100, new [] { 40, 50, 70 })]
+    [InlineData (Alignment.End, new [] { 33, 33, 33 }, 100, new [] { 1, 34, 67 })]
+    [InlineData (Alignment.End, new [] { 10 }, 101, new [] { 91 })]
+    [InlineData (Alignment.End, new [] { 10, 20 }, 101, new [] { 71, 81 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30 }, 101, new [] { 41, 51, 71 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30, 40 }, 101, new [] { 1, 11, 31, 61 })]
+    [InlineData (Alignment.End, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 1, 11, 31, 61, 101 })]
+    [InlineData (Alignment.Center, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.Center, new [] { 1 }, 2, new [] { 0 })]
+    [InlineData (Alignment.Center, new [] { 1 }, 3, new [] { 1 })]
+    [InlineData (Alignment.Center, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.Center, new [] { 1, 1 }, 3, new [] { 0, 1 })]
+    [InlineData (Alignment.Center, new [] { 1, 1 }, 4, new [] { 1, 2 })]
+    [InlineData (Alignment.Center, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 10, new [] { 2, 3, 5 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3 }, 11, new [] { 2, 3, 5 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 9, new [] { 0, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 10, new [] { 0, 3, 6 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 11, new [] { 1, 4, 7 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 12, new [] { 1, 4, 7 })]
+    [InlineData (Alignment.Center, new [] { 3, 3, 3 }, 13, new [] { 2, 5, 8 })]
     [InlineData (
-                    Alignment.Centered,
+                    Alignment.Center,
                     new [] { 1, 2, 3 },
                     5,
                     new [] { 0, 1, 3 })] // 5 is too small to fit the items. The first item is at 0, the items to the right are clipped.
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 66 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 101, new [] { 1, 34, 67 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 102, new [] { 1, 34, 67 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 103, new [] { 2, 35, 68 })]
-    [InlineData (Alignment.Centered, new [] { 33, 33, 33 }, 104, new [] { 2, 35, 68 })]
-    [InlineData (Alignment.Centered, new [] { 3, 4, 5, 6 }, 25, new [] { 3, 6, 10, 15 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30 }, 100, new [] { 0, 30, 70 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20, 30 }, 101, new [] { 0, 31, 71 })]
-    [InlineData (Alignment.Justified, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.Justified, new [] { 11, 17, 23 }, 100, new [] { 0, 36, 77 })]
-    [InlineData (Alignment.Justified, new [] { 1, 2, 3 }, 11, new [] { 0, 4, 8 })]
-    [InlineData (Alignment.Justified, new [] { 10, 20 }, 101, new [] { 0, 81 })]
-    [InlineData (Alignment.Justified, new [] { 10 }, 101, new [] { 0 })]
-    [InlineData (Alignment.Justified, new [] { 3, 3, 3 }, 21, new [] { 0, 9, 18 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5 }, 21, new [] { 0, 8, 16 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 18, new [] { 0, 3, 7, 12 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 19, new [] { 0, 4, 8, 13 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 20, new [] { 0, 4, 9, 14 })]
-    [InlineData (Alignment.Justified, new [] { 3, 4, 5, 6 }, 21, new [] { 0, 4, 9, 15 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 22, new [] { 0, 8, 14, 19 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 23, new [] { 0, 8, 15, 20 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 24, new [] { 0, 8, 15, 21 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 25, new [] { 0, 9, 16, 22 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 26, new [] { 0, 9, 17, 23 })]
-    [InlineData (Alignment.Justified, new [] { 6, 5, 4, 3 }, 31, new [] { 0, 11, 20, 28 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 0 }, 1, new [] { 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 0, 0, 0 }, 1, new [] { 0, 0, 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1 }, 2, new [] { 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1 }, 3, new [] { 2 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1 }, 3, new [] { 0, 2 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1 }, 4, new [] { 0, 3 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 4 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 8, new [] { 0, 1, 5 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 9, new [] { 0, 1, 6 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 10, new [] { 0, 1, 7 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3 }, 11, new [] { 0, 1, 8 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 7 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 1, 2, 3, 4 }, 12, new [] { 0, 1, 3, 8 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 3, 3, 3 }, 21, new [] { 0, 3, 18 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 3, 4, 5 }, 21, new [] { 0, 3, 16 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 67 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10 }, 101, new [] { 91 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20 }, 101, new [] { 0, 81 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30 }, 100, new [] { 0, 10, 70 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30 }, 101, new [] { 0, 10, 71 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 10, 30, 61 })]
-    [InlineData (Alignment.LastRightRestLeft, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 10, 30, 60, 101 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 0 }, 1, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 0, 0 }, 1, new [] { 0, 1 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1 }, 1, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1 }, 2, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1 }, 3, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1 }, 2, new [] { 0, 1 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1 }, 3, new [] { 0, 2 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1 }, 4, new [] { 0, 3 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 8, new [] { 0, 3, 5 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 9, new [] { 0, 4, 6 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 10, new [] { 0, 5, 7 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3 }, 11, new [] { 0, 6, 8 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 1, 2, 3, 4 }, 12, new [] { 0, 3, 5, 8 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 3, 3, 3 }, 21, new [] { 0, 15, 18 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 3, 4, 5 }, 21, new [] { 0, 12, 16 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10 }, 101, new [] { 0 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20 }, 101, new [] { 0, 81 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30 }, 100, new [] { 0, 50, 70 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30 }, 101, new [] { 0, 51, 71 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
-    [InlineData (Alignment.FirstLeftRestRight, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 66 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 101, new [] { 1, 34, 67 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 102, new [] { 1, 34, 67 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 103, new [] { 2, 35, 68 })]
+    [InlineData (Alignment.Center, new [] { 33, 33, 33 }, 104, new [] { 2, 35, 68 })]
+    [InlineData (Alignment.Center, new [] { 3, 4, 5, 6 }, 25, new [] { 3, 6, 10, 15 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30 }, 100, new [] { 0, 30, 70 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20, 30 }, 101, new [] { 0, 31, 71 })]
+    [InlineData (Alignment.Fill, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.Fill, new [] { 11, 17, 23 }, 100, new [] { 0, 36, 77 })]
+    [InlineData (Alignment.Fill, new [] { 1, 2, 3 }, 11, new [] { 0, 4, 8 })]
+    [InlineData (Alignment.Fill, new [] { 10, 20 }, 101, new [] { 0, 81 })]
+    [InlineData (Alignment.Fill, new [] { 10 }, 101, new [] { 0 })]
+    [InlineData (Alignment.Fill, new [] { 3, 3, 3 }, 21, new [] { 0, 9, 18 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5 }, 21, new [] { 0, 8, 16 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 18, new [] { 0, 3, 7, 12 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 19, new [] { 0, 4, 8, 13 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 20, new [] { 0, 4, 9, 14 })]
+    [InlineData (Alignment.Fill, new [] { 3, 4, 5, 6 }, 21, new [] { 0, 4, 9, 15 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 22, new [] { 0, 8, 14, 19 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 23, new [] { 0, 8, 15, 20 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 24, new [] { 0, 8, 15, 21 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 25, new [] { 0, 9, 16, 22 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 26, new [] { 0, 9, 17, 23 })]
+    [InlineData (Alignment.Fill, new [] { 6, 5, 4, 3 }, 31, new [] { 0, 11, 20, 28 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 0 }, 1, new [] { 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 0, 0, 0 }, 1, new [] { 0, 0, 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1 }, 2, new [] { 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1 }, 3, new [] { 2 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1 }, 3, new [] { 0, 2 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1 }, 4, new [] { 0, 3 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 7, new [] { 0, 1, 4 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 8, new [] { 0, 1, 5 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 9, new [] { 0, 1, 6 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 10, new [] { 0, 1, 7 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3 }, 11, new [] { 0, 1, 8 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 1, 3, 7 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 1, 2, 3, 4 }, 12, new [] { 0, 1, 3, 8 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 3, 3, 3 }, 21, new [] { 0, 3, 18 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 3, 4, 5 }, 21, new [] { 0, 3, 16 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 33, 33, 33 }, 100, new [] { 0, 33, 67 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10 }, 101, new [] { 91 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20 }, 101, new [] { 0, 81 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30 }, 100, new [] { 0, 10, 70 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30 }, 101, new [] { 0, 10, 71 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 10, 30, 61 })]
+    [InlineData (Alignment.LastEndRestStart, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 10, 30, 60, 101 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 0 }, 1, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 0, 0 }, 1, new [] { 0, 1 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 0, 0, 0 }, 1, new [] { 0, 1, 1 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1 }, 1, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1 }, 2, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1 }, 3, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1 }, 2, new [] { 0, 1 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1 }, 3, new [] { 0, 2 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1 }, 4, new [] { 0, 3 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 1, 1 }, 3, new [] { 0, 1, 2 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 6, new [] { 0, 1, 3 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 7, new [] { 0, 2, 4 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 8, new [] { 0, 3, 5 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 9, new [] { 0, 4, 6 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 10, new [] { 0, 5, 7 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3 }, 11, new [] { 0, 6, 8 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3, 4 }, 10, new [] { 0, 1, 3, 6 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3, 4 }, 11, new [] { 0, 2, 4, 7 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 1, 2, 3, 4 }, 12, new [] { 0, 3, 5, 8 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 3, 3, 3 }, 21, new [] { 0, 15, 18 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 3, 4, 5 }, 21, new [] { 0, 12, 16 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 33, 33, 33 }, 100, new [] { 0, 34, 67 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10 }, 101, new [] { 0 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20 }, 101, new [] { 0, 81 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30 }, 100, new [] { 0, 50, 70 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30 }, 101, new [] { 0, 51, 71 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30, 40 }, 101, new [] { 0, 11, 31, 61 })]
+    [InlineData (Alignment.FirstStartRestEnd, new [] { 10, 20, 30, 40, 50 }, 151, new [] { 0, 11, 31, 61, 101 })]
     public void Alignment_NoSpaceBetweenItems (Alignment alignment, int [] sizes, int containerSize, int [] expected)
     {
         int [] positions = new Aligner

File diff suppressed because it is too large
+ 143 - 143
UnitTests/Text/TextFormatterTests.cs


+ 2 - 2
UnitTests/View/DrawTests.cs

@@ -339,7 +339,7 @@ public class DrawTests (ITestOutputHelper _output)
             Text = "Test",
             Width = 6,
             Height = 1,
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             ColorScheme = Colors.ColorSchemes ["Base"]
         };
 
@@ -350,7 +350,7 @@ public class DrawTests (ITestOutputHelper _output)
             Y = 1,
             Width = 1,
             Height = 6,
-            VerticalTextAlignment = Alignment.Bottom,
+            VerticalTextAlignment = Alignment.End,
             ColorScheme = Colors.ColorSchemes ["Base"]
         };
         Toplevel top = new ();

+ 6 - 6
UnitTests/View/Layout/Dim.AutoTests.cs

@@ -787,11 +787,11 @@ public class DimAutoTests (ITestOutputHelper output)
         Assert.False (view.TextFormatter.AutoSize);
         Assert.Equal (Size.Empty, view.Frame.Size);
 
-        view.TextFormatter.Alignment = Alignment.Justified;
+        view.TextFormatter.Alignment = Alignment.Fill;
         Assert.False (view.TextFormatter.AutoSize);
         Assert.Equal (Size.Empty, view.Frame.Size);
 
-        view.TextFormatter.VerticalAlignment = Alignment.Centered;
+        view.TextFormatter.VerticalAlignment = Alignment.Center;
         Assert.False (view.TextFormatter.AutoSize);
         Assert.Equal (Size.Empty, view.Frame.Size);
 
@@ -815,11 +815,11 @@ public class DimAutoTests (ITestOutputHelper output)
         Assert.False (view.TextFormatter.AutoSize);
         Assert.Equal (Size.Empty, view.Frame.Size);
 
-        view.TextAlignment = Alignment.Justified;
+        view.TextAlignment = Alignment.Fill;
         Assert.False (view.TextFormatter.AutoSize);
         Assert.Equal (Size.Empty, view.Frame.Size);
 
-        view.VerticalTextAlignment = Alignment.Centered;
+        view.VerticalTextAlignment = Alignment.Center;
         Assert.False (view.TextFormatter.AutoSize);
         Assert.Equal (Size.Empty, view.Frame.Size);
 
@@ -844,7 +844,7 @@ public class DimAutoTests (ITestOutputHelper output)
         Assert.False (view.TextFormatter.AutoSize);
         Assert.NotEqual (Size.Empty, view.Frame.Size);
 
-        view.TextAlignment = Alignment.Justified;
+        view.TextAlignment = Alignment.Fill;
         Assert.False (view.TextFormatter.AutoSize);
         Assert.NotEqual (Size.Empty, view.Frame.Size);
 
@@ -853,7 +853,7 @@ public class DimAutoTests (ITestOutputHelper output)
             Text = "_1234",
             Width = Dim.Auto ()
         };
-        view.VerticalTextAlignment = Alignment.Centered;
+        view.VerticalTextAlignment = Alignment.Center;
         Assert.False (view.TextFormatter.AutoSize);
         Assert.NotEqual (Size.Empty, view.Frame.Size);
 

+ 10 - 13
UnitTests/View/Layout/Pos.AlignTests.cs

@@ -1,7 +1,4 @@
-using Xunit.Abstractions;
-using static Terminal.Gui.Dim;
-using static Terminal.Gui.Pos;
-
+
 namespace Terminal.Gui.PosDimTests;
 
 public class PosAlignTests ()
@@ -9,15 +6,15 @@ public class PosAlignTests ()
     [Fact]
     public void PosAlign_Constructor ()
     {
-        var posAlign = new PosAlign (Alignment.Justified);
+        var posAlign = new PosAlign (Alignment.Fill);
         Assert.NotNull (posAlign);
     }
 
     [Theory]
-    [InlineData (Alignment.Left, Alignment.Left, true)]
-    [InlineData (Alignment.Centered, Alignment.Centered, true)]
-    [InlineData (Alignment.Left, Alignment.Centered, false)]
-    [InlineData (Alignment.Centered, Alignment.Left, false)]
+    [InlineData (Alignment.Start, Alignment.Start, true)]
+    [InlineData (Alignment.Center, Alignment.Center, true)]
+    [InlineData (Alignment.Start, Alignment.Center, false)]
+    [InlineData (Alignment.Center, Alignment.Start, false)]
     public void PosAlign_Equals (Alignment align1, Alignment align2, bool expectedEquals)
     {
         var posAlign1 = new PosAlign (align1);
@@ -30,8 +27,8 @@ public class PosAlignTests ()
     [Fact]
     public void PosAlign_ToString ()
     {
-        var posAlign = new PosAlign (Alignment.Justified);
-        var expectedString = "Align(groupId=0, alignment=Justified)";
+        var posAlign = new PosAlign (Alignment.Fill);
+        var expectedString = "Align(groupId=0, alignment=Fill)";
 
         Assert.Equal (expectedString, posAlign.ToString ());
     }
@@ -39,7 +36,7 @@ public class PosAlignTests ()
     [Fact]
     public void PosAlign_Anchor ()
     {
-        var posAlign = new PosAlign (Alignment.Left);
+        var posAlign = new PosAlign (Alignment.Start);
         var width = 50;
         var expectedAnchor = -width;
 
@@ -49,7 +46,7 @@ public class PosAlignTests ()
     [Fact]
     public void PosAlign_CreatesCorrectInstance ()
     {
-        var pos = Pos.Align (Alignment.Left);
+        var pos = Pos.Align (Alignment.Start);
         Assert.IsType<PosAlign> (pos);
     }
 

+ 7 - 7
UnitTests/View/TextTests.cs

@@ -850,7 +850,7 @@ Y
             Y = 1,
             Width = width,
             Height = 1,
-            TextAlignment = Alignment.Centered
+            TextAlignment = Alignment.Center
         };
 
         if (autoSize)
@@ -865,7 +865,7 @@ Y
             Y = 2,
             Width = width,
             Height = 1,
-            TextAlignment = Alignment.Right
+            TextAlignment = Alignment.End
         };
 
         if (autoSize)
@@ -880,7 +880,7 @@ Y
             Y = 3,
             Width = width,
             Height = 1,
-            TextAlignment = Alignment.Justified
+            TextAlignment = Alignment.Fill
         };
 
         if (autoSize)
@@ -974,7 +974,7 @@ Y
             Width = 1,
             Height = height,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Centered
+            VerticalTextAlignment = Alignment.Center
         };
 
         if (autoSize)
@@ -990,7 +990,7 @@ Y
             Width = 1,
             Height = height,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Bottom
+            VerticalTextAlignment = Alignment.End
         };
 
         if (autoSize)
@@ -1006,7 +1006,7 @@ Y
             Width = 1,
             Height = height,
             TextDirection = TextDirection.TopBottom_LeftRight,
-            VerticalTextAlignment = Alignment.Justified
+            VerticalTextAlignment = Alignment.Fill
         };
 
         if (autoSize)
@@ -1227,7 +1227,7 @@ Y
         {
             Text = "01234",
             TextDirection = TextDirection.LeftRight_TopBottom,
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 10,
             Height = Dim.Auto (DimAutoStyle.Text)
         };

+ 4 - 4
UnitTests/Views/ButtonTests.cs

@@ -155,14 +155,14 @@ public class ButtonTests (ITestOutputHelper output)
 
         Assert.Equal ($"{CM.Glyphs.LeftBracket}  {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
         Assert.False (btn.IsDefault);
-        Assert.Equal (Alignment.Centered, btn.TextAlignment);
+        Assert.Equal (Alignment.Center, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
         Assert.Equal (new (0, 0, 4, 1), btn.Viewport);
         Assert.Equal (new (0, 0, 4, 1), btn.Frame);
         Assert.Equal ($"{CM.Glyphs.LeftBracket}  {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
         Assert.False (btn.IsDefault);
-        Assert.Equal (Alignment.Centered, btn.TextAlignment);
+        Assert.Equal (Alignment.Center, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
         Assert.Equal (new (0, 0, 4, 1), btn.Viewport);
@@ -195,7 +195,7 @@ public class ButtonTests (ITestOutputHelper output)
                       btn.TextFormatter.Format ()
                      );
         Assert.True (btn.IsDefault);
-        Assert.Equal (Alignment.Centered, btn.TextAlignment);
+        Assert.Equal (Alignment.Center, btn.TextAlignment);
         Assert.True (btn.CanFocus);
 
         btn.SetRelativeLayout (new (100, 100));
@@ -222,7 +222,7 @@ public class ButtonTests (ITestOutputHelper output)
                       btn.TextFormatter.Format ()
                      );
         Assert.True (btn.IsDefault);
-        Assert.Equal (Alignment.Centered, btn.TextAlignment);
+        Assert.Equal (Alignment.Center, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
 

+ 9 - 9
UnitTests/Views/CheckBoxTests.cs

@@ -251,7 +251,7 @@ public class CheckBoxTests
             X = 1,
             Y = Pos.Center (),
             Text = "Check this out 你",
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 25
         };
         var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
@@ -262,7 +262,7 @@ public class CheckBoxTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
-        Assert.Equal (Alignment.Centered, checkBox.TextAlignment);
+        Assert.Equal (Alignment.Center, checkBox.TextAlignment);
         Assert.Equal (new (1, 1, 25, 1), checkBox.Frame);
         Assert.Equal (_size25x1, checkBox.TextFormatter.Size);
 
@@ -301,7 +301,7 @@ public class CheckBoxTests
             X = 1,
             Y = Pos.Center (),
             Text = "Check first out 你",
-            TextAlignment = Alignment.Justified,
+            TextAlignment = Alignment.Fill,
             Width = 25
         };
 
@@ -310,7 +310,7 @@ public class CheckBoxTests
             X = 1,
             Y = Pos.Bottom (checkBox1),
             Text = "Check second out 你",
-            TextAlignment = Alignment.Justified,
+            TextAlignment = Alignment.Fill,
             Width = 25
         };
         var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
@@ -321,9 +321,9 @@ public class CheckBoxTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (30, 6);
 
-        Assert.Equal (Alignment.Justified, checkBox1.TextAlignment);
+        Assert.Equal (Alignment.Fill, checkBox1.TextAlignment);
         Assert.Equal (new (1, 1, 25, 1), checkBox1.Frame);
-        Assert.Equal (Alignment.Justified, checkBox2.TextAlignment);
+        Assert.Equal (Alignment.Fill, checkBox2.TextAlignment);
         Assert.Equal (new (1, 2, 25, 1), checkBox2.Frame);
  
         var expected = @$"
@@ -378,7 +378,7 @@ public class CheckBoxTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
-        Assert.Equal (Alignment.Left, checkBox.TextAlignment);
+        Assert.Equal (Alignment.Start, checkBox.TextAlignment);
         Assert.Equal (new (1, 1, 25, 1), checkBox.Frame);
         Assert.Equal (_size25x1, checkBox.TextFormatter.Size);
 
@@ -417,7 +417,7 @@ public class CheckBoxTests
             X = 1,
             Y = Pos.Center (),
             Text = "Check this out 你",
-            TextAlignment = Alignment.Right,
+            TextAlignment = Alignment.End,
             Width = 25
         };
         var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
@@ -428,7 +428,7 @@ public class CheckBoxTests
         Application.Begin (top);
         ((FakeDriver)Application.Driver).SetBufferSize (30, 5);
 
-        Assert.Equal (Alignment.Right, checkBox.TextAlignment);
+        Assert.Equal (Alignment.End, checkBox.TextAlignment);
         Assert.Equal (new (1, 1, 25, 1), checkBox.Frame);
         Assert.Equal (_size25x1, checkBox.TextFormatter.Size);
 

+ 1 - 1
UnitTests/Views/LabelTests.cs

@@ -207,7 +207,7 @@ public class LabelTests
     {
         var label = new Label ();
         Assert.Equal (string.Empty, label.Text);
-        Assert.Equal (Alignment.Left, label.TextAlignment);
+        Assert.Equal (Alignment.Start, label.TextAlignment);
         Assert.False (label.CanFocus);
         Assert.Equal (new Rectangle (0, 0, 0, 0), label.Frame);
         Assert.Equal (KeyCode.Null, label.HotKey);

+ 20 - 20
UnitTests/Views/TextValidateFieldTests.cs

@@ -10,7 +10,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ****
@@ -44,7 +44,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Left,
+            TextAlignment = Alignment.Start,
             Width = 30,
 
             //                                             ****
@@ -81,7 +81,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ****
@@ -115,7 +115,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             *
@@ -137,7 +137,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             *
@@ -161,7 +161,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ****
@@ -179,7 +179,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ****
@@ -196,7 +196,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ****
@@ -214,7 +214,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             *
@@ -233,7 +233,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             *
@@ -253,7 +253,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ** **
@@ -283,7 +283,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             *
@@ -308,7 +308,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Left,
+            TextAlignment = Alignment.Start,
             Width = 30,
 
             //                                             ****
@@ -338,7 +338,7 @@ public class TextValidateField_NET_Provider_Tests
 
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Left, Width = 30, Provider = new NetMaskedTextProvider ("--(0000)--")
+            TextAlignment = Alignment.Start, Width = 30, Provider = new NetMaskedTextProvider ("--(0000)--")
         };
 
         field.Provider.TextChanged += (sender, e) => wasTextChanged = true;
@@ -356,7 +356,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             *
@@ -381,7 +381,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Left,
+            TextAlignment = Alignment.Start,
             Width = 30,
 
             //                                             ****
@@ -400,7 +400,7 @@ public class TextValidateField_NET_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
 
             //                                             ****
@@ -540,7 +540,7 @@ public class TextValidateField_Regex_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
             Provider = new TextRegexProvider ("^[0-9][0-9][0-9]$") { ValidateOnInput = false }
         };
@@ -596,7 +596,7 @@ public class TextValidateField_Regex_Provider_Tests
 
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
             Provider = new TextRegexProvider ("^[0-9][0-9][0-9]$") { ValidateOnInput = false }
         };
@@ -616,7 +616,7 @@ public class TextValidateField_Regex_Provider_Tests
     {
         var field = new TextValidateField
         {
-            TextAlignment = Alignment.Centered,
+            TextAlignment = Alignment.Center,
             Width = 20,
             Provider = new TextRegexProvider ("^[0-9][0-9][0-9]$") { ValidateOnInput = false }
         };

+ 2 - 2
UnitTests/Views/ToplevelTests.cs

@@ -1453,8 +1453,8 @@ public class ToplevelTests
                         Y = Pos.Center (),
                         Width = Dim.Fill (),
                         Height = Dim.Fill (),
-                        TextAlignment = Alignment.Centered,
-                        VerticalTextAlignment = Alignment.Centered,
+                        TextAlignment = Alignment.Center,
+                        VerticalTextAlignment = Alignment.Center,
                         Text = "Test"
                     }
                    );

Some files were not shown because too many files changed in this diff