From 37073d29b5126d31457b1f26c8c80f467bc4fce1 Mon Sep 17 00:00:00 2001 From: Tig Date: Fri, 10 May 2024 09:56:14 -0600 Subject: [PATCH] Alignment->Justification --- Terminal.Gui/Drawing/Thickness.cs | 4 +- Terminal.Gui/Text/TextFormatter.cs | 119 ++++++++------- Terminal.Gui/View/ViewText.cs | 18 +-- Terminal.Gui/Views/Dialog.cs | 10 +- Terminal.Gui/Views/Menu/Menu.cs | 2 +- Terminal.Gui/Views/ProgressBar.cs | 2 +- Terminal.Gui/Views/TableView/ColumnStyle.cs | 42 +++--- Terminal.Gui/Views/TableView/TableStyle.cs | 4 +- Terminal.Gui/Views/TableView/TableView.cs | 2 +- Terminal.Gui/Views/TextValidateField.cs | 2 +- Terminal.Gui/Views/Wizard/Wizard.cs | 2 +- UICatalog/Scenarios/Buttons.cs | 2 +- UICatalog/Scenarios/ComputedLayout.cs | 4 +- UICatalog/Scenarios/CsvEditor.cs | 16 +- UICatalog/Scenarios/Dialogs.cs | 2 +- UICatalog/Scenarios/TableEditor.cs | 8 +- UICatalog/Scenarios/TextAlignments.cs | 142 ------------------ UICatalog/Scenarios/TextFormatterDemo.cs | 14 +- ...on.cs => TextJustificationAndDirection.cs} | 6 +- UnitTests/Dialogs/DialogTests.cs | 10 +- UnitTests/Text/TextFormatterTests.cs | 38 ++--- UnitTests/View/Layout/Dim.AutoTests.cs | 4 +- UnitTests/View/Text/AutoSizeTrueTests.cs | 2 +- 23 files changed, 164 insertions(+), 291 deletions(-) delete mode 100644 UICatalog/Scenarios/TextAlignments.cs rename UICatalog/Scenarios/{TextAlignmentsAndDirection.cs => TextJustificationAndDirection.cs} (98%) diff --git a/Terminal.Gui/Drawing/Thickness.cs b/Terminal.Gui/Drawing/Thickness.cs index 74458d221..68f78c3d3 100644 --- a/Terminal.Gui/Drawing/Thickness.cs +++ b/Terminal.Gui/Drawing/Thickness.cs @@ -232,8 +232,8 @@ public class Thickness : IEquatable var tf = new TextFormatter { Text = label is null ? string.Empty : $"{label} {this}", - Alignment = Justification.Centered, - VerticalAlignment = Justification.Bottom, + Justification = Justification.Centered, + VerticalJustification = Justification.Bottom, AutoSize = true }; tf.Draw (rect, Application.Driver.CurrentAttribute, Application.Driver.CurrentAttribute, rect); diff --git a/Terminal.Gui/Text/TextFormatter.cs b/Terminal.Gui/Text/TextFormatter.cs index 5bdca378d..efa179a7e 100644 --- a/Terminal.Gui/Text/TextFormatter.cs +++ b/Terminal.Gui/Text/TextFormatter.cs @@ -1,7 +1,9 @@ +using System.Diagnostics; + namespace Terminal.Gui; /// -/// Provides text formatting. Supports s, horizontal alignment, vertical alignment, +/// Provides text formatting. Supports s, horizontal justification, vertical justification, /// multiple lines, and word-based line wrap. /// public class TextFormatter @@ -15,25 +17,24 @@ public class TextFormatter private Size _size; private int _tabWidth = 4; private string _text; - private Justification _textAlignment; + private Justification _textJustification; private TextDirection _textDirection; - private Justification _textVerticalAlignment; + private Justification _textVerticalJustification; private bool _wordWrap = true; - /// Controls the horizontal text-alignment property. - /// The text alignment. - public Justification Alignment + /// Get or sets the horizontal text justification. + /// The text justification. + public Justification Justification { - get => _textAlignment; - set => _textAlignment = EnableNeedsFormat (value); + get => _textJustification; + set => _textJustification = EnableNeedsFormat (value); } /// Gets or sets whether the should be automatically changed to fit the . /// /// Used when is using to resize the view's to fit . /// - /// AutoSize is ignored if and - /// are used. + /// AutoSize is ignored if is used. /// /// public bool AutoSize @@ -68,9 +69,8 @@ public class TextFormatter /// Only the first HotKey specifier found in is supported. /// /// - /// If (the default) the width required for the HotKey specifier is returned. Otherwise the - /// height - /// is returned. + /// If (the default) the width required for the HotKey specifier is returned. Otherwise, the + /// height is returned. /// /// /// The number of characters required for the . If the text @@ -97,8 +97,8 @@ public class TextFormatter /// public int CursorPosition { get; internal set; } - /// Controls the text-direction property. - /// The text vertical alignment. + /// Gets or sets the text-direction. + /// The text direction. public TextDirection Direction { get => _textDirection; @@ -112,8 +112,7 @@ public class TextFormatter } } } - - + /// /// Determines if the viewport width will be used or only the text width will be used, /// If all the viewport area will be filled with whitespaces and the same background color @@ -223,12 +222,12 @@ public class TextFormatter } } - /// Controls the vertical text-alignment property. - /// The text vertical alignment. - public Justification VerticalAlignment + /// Gets or sets the vertical text-justification. + /// The text vertical justification. + public Justification VerticalJustification { - get => _textVerticalAlignment; - set => _textVerticalAlignment = EnableNeedsFormat (value); + get => _textVerticalJustification; + set => _textVerticalJustification = EnableNeedsFormat (value); } /// Gets or sets whether word wrap will be used to fit to . @@ -318,10 +317,10 @@ public class TextFormatter // When text is justified, we lost left or right, so we use the direction to align. - int x, y; + int x = 0, y = 0; - // Horizontal Alignment - if (Alignment is Justification.Right) + // Horizontal Justification + if (Justification is Justification.Right) { if (isVertical) { @@ -336,7 +335,7 @@ public class TextFormatter CursorPosition = screen.Width - runesWidth + (_hotKeyPos > -1 ? _hotKeyPos : 0); } } - else if (Alignment is Justification.Left) + else if (Justification is Justification.Left) { if (isVertical) { @@ -352,7 +351,7 @@ public class TextFormatter CursorPosition = _hotKeyPos > -1 ? _hotKeyPos : 0; } - else if (Alignment is Justification.Justified) + else if (Justification is Justification.Justified) { if (isVertical) { @@ -375,7 +374,7 @@ public class TextFormatter CursorPosition = _hotKeyPos > -1 ? _hotKeyPos : 0; } - else if (Alignment is Justification.Centered) + else if (Justification is Justification.Centered) { if (isVertical) { @@ -395,11 +394,13 @@ public class TextFormatter } else { - throw new ArgumentOutOfRangeException ($"{nameof (Alignment)}"); + Debug.WriteLine ($"Unsupported Justification: {nameof (VerticalJustification)}"); + + return; } - // Vertical Alignment - if (VerticalAlignment is Justification.Bottom) + // Vertical Justification + if (VerticalJustification is Justification.Bottom) { if (isVertical) { @@ -410,7 +411,7 @@ public class TextFormatter y = screen.Bottom - linesFormatted.Count + line; } } - else if (VerticalAlignment is Justification.Top) + else if (VerticalJustification is Justification.Top) { if (isVertical) { @@ -421,7 +422,7 @@ public class TextFormatter y = screen.Top + line; } } - else if (VerticalAlignment is Justification.Justified) + else if (VerticalJustification is Justification.Justified) { if (isVertical) { @@ -435,7 +436,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 Justification.Centered) + else if (VerticalJustification is Justification.Centered) { if (isVertical) { @@ -450,7 +451,9 @@ public class TextFormatter } else { - throw new ArgumentOutOfRangeException ($"{nameof (VerticalAlignment)}"); + Debug.WriteLine ($"Unsupported Justification: {nameof (VerticalJustification)}"); + + return; } int colOffset = screen.X < 0 ? Math.Abs (screen.X) : 0; @@ -471,8 +474,8 @@ public class TextFormatter { if (idx < 0 || (isVertical - ? VerticalAlignment != Justification.Bottom && current < 0 - : Alignment != Justification.Right && x + current + colOffset < 0)) + ? VerticalJustification != Justification.Bottom && current < 0 + : Justification != Justification.Right && x + current + colOffset < 0)) { current++; @@ -561,7 +564,7 @@ public class TextFormatter if (HotKeyPos > -1 && idx == HotKeyPos) { - if ((isVertical && VerticalAlignment == Justification.Justified) || (!isVertical && Alignment == Justification.Justified)) + if ((isVertical && VerticalJustification == Justification.Justified) || (!isVertical && Justification == Justification.Justified)) { CursorPosition = idx - start; } @@ -699,7 +702,7 @@ public class TextFormatter _lines = Format ( text, Size.Height, - VerticalAlignment == Justification.Justified, + VerticalJustification == Justification.Justified, Size.Width > colsWidth && WordWrap, PreserveTrailingSpaces, TabWidth, @@ -723,7 +726,7 @@ public class TextFormatter _lines = Format ( text, Size.Width, - Alignment == Justification.Justified, + Justification == Justification.Justified, Size.Height > 1 && WordWrap, PreserveTrailingSpaces, TabWidth, @@ -977,7 +980,7 @@ public class TextFormatter // if value is not wide enough if (text.EnumerateRunes ().Sum (c => c.GetColumns ()) < width) { - // pad it out with spaces to the given alignment + // pad it out with spaces to the given Justification int toPad = width - text.EnumerateRunes ().Sum (c => c.GetColumns ()); return text + new string (' ', toPad); @@ -1031,7 +1034,7 @@ public class TextFormatter List runes = StripCRLF (text).ToRuneList (); int start = Math.Max ( - !runes.Contains ((Rune)' ') && textFormatter is { VerticalAlignment: Justification.Bottom } && IsVerticalDirection (textDirection) + !runes.Contains ((Rune)' ') && textFormatter is { VerticalJustification: Justification.Bottom } && IsVerticalDirection (textDirection) ? runes.Count - width : 0, 0); @@ -1249,7 +1252,7 @@ public class TextFormatter /// The number of columns to clip the text to. Text longer than will be /// clipped. /// - /// Alignment. + /// Justification. /// The text direction. /// The number of columns used for a tab. /// instance to access any of his objects. @@ -1257,13 +1260,13 @@ public class TextFormatter public static string ClipAndJustify ( string text, int width, - Justification talign, + Justification textJustification, TextDirection textDirection = TextDirection.LeftRight_TopBottom, int tabWidth = 0, TextFormatter textFormatter = null ) { - return ClipAndJustify (text, width, talign == Justification.Justified, textDirection, tabWidth, textFormatter); + return ClipAndJustify (text, width, textJustification == Justification.Justified, textDirection, tabWidth, textFormatter); } /// Justifies text within a specified width. @@ -1304,12 +1307,12 @@ public class TextFormatter { if (IsHorizontalDirection (textDirection)) { - if (textFormatter is { Alignment: Justification.Right }) + if (textFormatter is { Justification: Justification.Right }) { return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection); } - if (textFormatter is { Alignment: Justification.Centered }) + if (textFormatter is { Justification: Justification.Centered }) { return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection); } @@ -1319,12 +1322,12 @@ public class TextFormatter if (IsVerticalDirection (textDirection)) { - if (textFormatter is { VerticalAlignment: Justification.Bottom }) + if (textFormatter is { VerticalJustification: Justification.Bottom }) { return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection); } - if (textFormatter is { VerticalAlignment: Justification.Centered }) + if (textFormatter is { VerticalJustification: Justification.Centered }) { return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection); } @@ -1342,14 +1345,14 @@ public class TextFormatter if (IsHorizontalDirection (textDirection)) { - if (textFormatter is { Alignment: Justification.Right }) + if (textFormatter is { Justification: Justification.Right }) { if (GetRuneWidth (text, tabWidth, textDirection) > width) { return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection); } } - else if (textFormatter is { Alignment: Justification.Centered }) + else if (textFormatter is { Justification: Justification.Centered }) { return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection); } @@ -1361,14 +1364,14 @@ public class TextFormatter if (IsVerticalDirection (textDirection)) { - if (textFormatter is { VerticalAlignment: Justification.Bottom }) + if (textFormatter is { VerticalJustification: Justification.Bottom }) { if (runes.Count - zeroLength > width) { return GetRangeThatFits (runes, runes.Count - width, text, width, tabWidth, textDirection); } } - else if (textFormatter is { VerticalAlignment: Justification.Centered }) + else if (textFormatter is { VerticalJustification: Justification.Centered }) { return GetRangeThatFits (runes, Math.Max ((runes.Count - width) / 2, 0), text, width, tabWidth, textDirection); } @@ -1472,10 +1475,10 @@ public class TextFormatter return s.ToString (); } - /// Formats text into lines, applying text alignment and optionally wrapping text to new lines on word boundaries. + /// Formats text into lines, applying text justification and optionally wrapping text to new lines on word boundaries. /// /// The number of columns to constrain the text to for word wrapping and clipping. - /// Specifies how the text will be aligned horizontally. + /// Specifies how the text will be justified horizontally. /// /// If , the text will be wrapped to new lines no longer than /// . If , forces text to fit a single line. Line breaks are converted @@ -1498,7 +1501,7 @@ public class TextFormatter public static List Format ( string text, int width, - Justification talign, + Justification textJustification, bool wordWrap, bool preserveTrailingSpaces = false, int tabWidth = 0, @@ -1510,7 +1513,7 @@ public class TextFormatter return Format ( text, width, - talign == Justification.Justified, + textJustification == Justification.Justified, wordWrap, preserveTrailingSpaces, tabWidth, @@ -1520,7 +1523,7 @@ public class TextFormatter ); } - /// Formats text into lines, applying text alignment and optionally wrapping text to new lines on word boundaries. + /// Formats text into lines, applying text justification and optionally wrapping text to new lines on word boundaries. /// /// The number of columns to constrain the text to for word wrapping and clipping. /// Specifies whether the text should be justified. diff --git a/Terminal.Gui/View/ViewText.cs b/Terminal.Gui/View/ViewText.cs index 19f534ad5..d6490020f 100644 --- a/Terminal.Gui/View/ViewText.cs +++ b/Terminal.Gui/View/ViewText.cs @@ -80,19 +80,19 @@ public partial class View public event EventHandler> TextChanged; /// - /// Gets or sets how the View's is aligned horizontally when drawn. Changing this property will + /// Gets or sets how the View's is justified horizontally when drawn. Changing this property will /// redisplay the . /// /// /// or are using , the will be adjusted to fit the text. /// - /// The text alignment. + /// The text justification. public virtual Justification Justification { - get => TextFormatter.Alignment; + get => TextFormatter.Justification; set { - TextFormatter.Alignment = value; + TextFormatter.Justification = value; UpdateTextFormatterText (); OnResizeNeeded (); } @@ -105,7 +105,7 @@ public partial class View /// /// or are using , the will be adjusted to fit the text. /// - /// The text alignment. + /// The text direction. public virtual TextDirection TextDirection { get => TextFormatter.Direction; @@ -122,20 +122,20 @@ public partial class View public TextFormatter TextFormatter { get; init; } = new () { }; /// - /// Gets or sets how the View's is aligned vertically when drawn. Changing this property will + /// Gets or sets how the View's is justified vertically when drawn. Changing this property will /// redisplay /// the . /// /// /// or are using , the will be adjusted to fit the text. /// - /// The text alignment. + /// The vertical text justification. public virtual Justification VerticalJustification { - get => TextFormatter.VerticalAlignment; + get => TextFormatter.VerticalJustification; set { - TextFormatter.VerticalAlignment = value; + TextFormatter.VerticalJustification = value; SetNeedsDisplay (); } } diff --git a/Terminal.Gui/Views/Dialog.cs b/Terminal.Gui/Views/Dialog.cs index fc1196be5..6f9c251f7 100644 --- a/Terminal.Gui/Views/Dialog.cs +++ b/Terminal.Gui/Views/Dialog.cs @@ -51,7 +51,7 @@ public class Dialog : Window ColorScheme = Colors.ColorSchemes ["Dialog"]; Modal = true; - ButtonAlignment = DefaultButtonJustification; + ButtonJustification = DefaultButtonJustification; AddCommand ( Command.QuitToplevel, @@ -96,9 +96,9 @@ public class Dialog : Window } } - // TODO: Update button.X = Pos.Justify when alignment changes - /// Determines how the s are aligned along the bottom of the dialog. - public Justification ButtonAlignment { get; set; } + // TODO: Update button.X = Pos.Justify when justification changes + /// Determines how the s are justified along the bottom of the dialog. + public Justification ButtonJustification { get; set; } /// Optional buttons to lay out at the bottom of the dialog. public Button [] Buttons @@ -136,7 +136,7 @@ public class Dialog : Window return; } - button.X = Pos.Justify (ButtonAlignment); + button.X = Pos.Justify (ButtonJustification); button.Y = Pos.AnchorEnd () - 1; _buttons.Add (button); diff --git a/Terminal.Gui/Views/Menu/Menu.cs b/Terminal.Gui/Views/Menu/Menu.cs index 1d6a92de6..3033985ab 100644 --- a/Terminal.Gui/Views/Menu/Menu.cs +++ b/Terminal.Gui/Views/Menu/Menu.cs @@ -891,7 +891,7 @@ internal sealed class Menu : View var tf = new TextFormatter { AutoSize = true, - Alignment = Justification.Centered, HotKeySpecifier = MenuBar.HotKeySpecifier, Text = textToDraw + Justification = Justification.Centered, HotKeySpecifier = MenuBar.HotKeySpecifier, Text = textToDraw }; // The -3 is left/right border + one space (not sure what for) diff --git a/Terminal.Gui/Views/ProgressBar.cs b/Terminal.Gui/Views/ProgressBar.cs index 47c520db9..cebe9900a 100644 --- a/Terminal.Gui/Views/ProgressBar.cs +++ b/Terminal.Gui/Views/ProgressBar.cs @@ -181,7 +181,7 @@ public class ProgressBar : View if (ProgressBarFormat != ProgressBarFormat.Simple && !_isActivity) { - var tf = new TextFormatter { Alignment = Justification.Centered, Text = Text }; + var tf = new TextFormatter { Justification = Justification.Centered, Text = Text }; var attr = new Attribute (ColorScheme.HotNormal.Foreground, ColorScheme.HotNormal.Background); if (_fraction > .5) diff --git a/Terminal.Gui/Views/TableView/ColumnStyle.cs b/Terminal.Gui/Views/TableView/ColumnStyle.cs index 2490d66f6..17b22dc5b 100644 --- a/Terminal.Gui/Views/TableView/ColumnStyle.cs +++ b/Terminal.Gui/Views/TableView/ColumnStyle.cs @@ -1,17 +1,17 @@ namespace Terminal.Gui; /// -/// Describes how to render a given column in a including and +/// Describes how to render a given column in a including and /// textual representation of cells (e.g. date formats) /// See TableView Deep Dive for more information. /// public class ColumnStyle { /// - /// Defines a delegate for returning custom alignment per cell based on cell values. When specified this will - /// override + /// Defines a delegate for returning custom justification per cell based on cell values. When specified this will + /// override /// - public Func AlignmentGetter; + public Func JustificationGetter; /// /// Defines a delegate for returning a custom color scheme per cell based on cell values. Return null for the @@ -20,26 +20,26 @@ public class ColumnStyle public CellColorGetterDelegate ColorGetter; /// - /// Defines a delegate for returning custom representations of cell values. If not set then - /// is used. Return values from your delegate may be truncated e.g. based on + /// Defines a delegate for returning custom representations of cell values. If not set then + /// is used. Return values from your delegate may be truncated e.g. based on /// /// public Func RepresentationGetter; - private bool visible = true; + private bool _visible = true; /// - /// Defines the default alignment for all values rendered in this column. For custom alignment based on cell - /// contents use . + /// Defines the default justification for all values rendered in this column. For custom justification based on cell + /// contents use . /// - public Justification Alignment { get; set; } + public Justification Justification { get; set; } /// Defines the format for values e.g. "yyyy-MM-dd" for dates public string Format { get; set; } /// - /// Set the maximum width of the column in characters. This value will be ignored if more than the tables - /// . Defaults to + /// Set the maximum width of the column in characters. This value will be ignored if more than the tables + /// . Defaults to /// public int MaxWidth { get; set; } = TableView.DefaultMaxCellWidth; @@ -47,7 +47,7 @@ public class ColumnStyle public int MinAcceptableWidth { get; set; } = TableView.DefaultMinAcceptableWidth; /// - /// Set the minimum width of the column in characters. Setting this will ensure that even when a column has short + /// Set the minimum width of the column in characters. Setting this will ensure that even when a column has short /// content/header it still fills a given width of the control. /// /// This value will be ignored if more than the tables or the @@ -64,24 +64,24 @@ public class ColumnStyle /// If is 0 then will always return false. public bool Visible { - get => MaxWidth >= 0 && visible; - set => visible = value; + get => MaxWidth >= 0 && _visible; + set => _visible = value; } /// - /// Returns the alignment for the cell based on and / - /// + /// Returns the justification for the cell based on and / + /// /// /// /// - public Justification GetAlignment (object cellValue) + public Justification GetJustification (object cellValue) { - if (AlignmentGetter is { }) + if (JustificationGetter is { }) { - return AlignmentGetter (cellValue); + return JustificationGetter (cellValue); } - return Alignment; + return Justification; } /// diff --git a/Terminal.Gui/Views/TableView/TableStyle.cs b/Terminal.Gui/Views/TableView/TableStyle.cs index 2cf258bee..4dd947734 100644 --- a/Terminal.Gui/Views/TableView/TableStyle.cs +++ b/Terminal.Gui/Views/TableView/TableStyle.cs @@ -15,11 +15,11 @@ public class TableStyle /// public bool AlwaysUseNormalColorForVerticalCellLines { get; set; } = false; - /// Collection of columns for which you want special rendering (e.g. custom column lengths, text alignment etc) + /// Collection of columns for which you want special rendering (e.g. custom column lengths, text justification, etc.) public Dictionary ColumnStyles { get; set; } = new (); /// - /// Determines rendering when the last column in the table is visible but it's content or + /// Determines rendering when the last column in the table is visible, but it's content or /// is less than the remaining space in the control. True (the default) will expand /// the column to fill the remaining bounds of the control. False will draw a column ending line and leave a blank /// column that cannot be selected in the remaining space. diff --git a/Terminal.Gui/Views/TableView/TableView.cs b/Terminal.Gui/Views/TableView/TableView.cs index 190fef041..4aab25ac1 100644 --- a/Terminal.Gui/Views/TableView/TableView.cs +++ b/Terminal.Gui/Views/TableView/TableView.cs @@ -2085,7 +2085,7 @@ public class TableView : View - (representation.EnumerateRunes ().Sum (c => c.GetColumns ()) + 1 /*leave 1 space for cell boundary*/); - switch (colStyle?.GetAlignment (originalCellValue) ?? Justification.Left) + switch (colStyle?.GetJustification (originalCellValue) ?? Justification.Left) { case Justification.Left: return representation + new string (' ', toPad); diff --git a/Terminal.Gui/Views/TextValidateField.cs b/Terminal.Gui/Views/TextValidateField.cs index f2d4cc1bf..9ffa318b7 100644 --- a/Terminal.Gui/Views/TextValidateField.cs +++ b/Terminal.Gui/Views/TextValidateField.cs @@ -709,7 +709,7 @@ namespace Terminal.Gui return true; } - /// Margins for text alignment. + /// Margins for text justification. /// Total width /// Left and right margins private (int left, int right) GetMargins (int width) diff --git a/Terminal.Gui/Views/Wizard/Wizard.cs b/Terminal.Gui/Views/Wizard/Wizard.cs index 5161ca1ef..8046106eb 100644 --- a/Terminal.Gui/Views/Wizard/Wizard.cs +++ b/Terminal.Gui/Views/Wizard/Wizard.cs @@ -85,7 +85,7 @@ public class Wizard : Dialog { // Using Justify causes the Back and Next buttons to be hard justified against // the left and right edge - ButtonAlignment = Justification.Justified; + ButtonJustification = Justification.Justified; BorderStyle = LineStyle.Double; //// Add a horiz separator diff --git a/UICatalog/Scenarios/Buttons.cs b/UICatalog/Scenarios/Buttons.cs index 57d7ba179..bd2e9de04 100644 --- a/UICatalog/Scenarios/Buttons.cs +++ b/UICatalog/Scenarios/Buttons.cs @@ -209,7 +209,7 @@ public class Buttons : Scenario var label = new Label { - X = 2, Y = Pos.Bottom (computedFrame) + 1, Text = "Text Alignment (changes the four buttons above): " + X = 2, Y = Pos.Bottom (computedFrame) + 1, Text = "Text Justification (changes the four buttons above): " }; main.Add (label); diff --git a/UICatalog/Scenarios/ComputedLayout.cs b/UICatalog/Scenarios/ComputedLayout.cs index f88056843..83a679d91 100644 --- a/UICatalog/Scenarios/ComputedLayout.cs +++ b/UICatalog/Scenarios/ComputedLayout.cs @@ -86,7 +86,7 @@ public class ComputedLayout : Scenario var i = 1; var txt = "Resize the terminal to see computed layout in action."; List