Browse Source

Auto-join is mostly all working

Tig 8 months ago
parent
commit
e2bb22eb04

+ 1 - 0
Terminal.Gui/View/Adornment/Border.cs

@@ -84,6 +84,7 @@ public class Border : Adornment
             {
                 DrawIndicator = new SpinnerView ()
                 {
+                    Id = "DrawIndicator",
                     X = 1,
                     Style = new SpinnerStyle.Dots2 (),
                     SpinDelay = 0,

+ 9 - 30
Terminal.Gui/View/View.Drawing.cs

@@ -130,7 +130,7 @@ public partial class View // Drawing APIs
     {
         if (Border?.Subviews is { } && Border.Thickness != Thickness.Empty)
         {
-            foreach (View subview in Border.Subviews.Where (v => v.Visible))
+            foreach (View subview in Border.Subviews.Where (v => v.Visible || v.Id == "DrawIndicator"))
             {
                 subview.SetNeedsDraw ();
                 LineCanvas.Exclude (new (subview.FrameToScreen()));
@@ -178,7 +178,7 @@ public partial class View // Drawing APIs
     {
         // We do not attempt to draw Margin. It is drawn in a separate pass.
 
-        // Each of these renders lines to either this View's LineCanvas 
+        // Each of these renders lines to this View's LineCanvas 
         // Those lines will be finally rendered in OnRenderLineCanvas
         if (Border is { } && Border.Thickness != Thickness.Empty)
         {
@@ -189,6 +189,7 @@ public partial class View // Drawing APIs
         {
             Padding?.Draw ();
         }
+
     }
 
     /// <summary>
@@ -485,6 +486,12 @@ public partial class View // Drawing APIs
                 view.SetNeedsDraw ();
             }
             view.Draw ();
+
+            if (view.SuperViewRendersLineCanvas)
+            {
+                LineCanvas.Merge (view.LineCanvas);
+                view.LineCanvas.Clear ();
+            }
         }
     }
 
@@ -531,14 +538,11 @@ public partial class View // Drawing APIs
     /// </summary>
     public void RenderLineCanvas ()
     {
-        // TODO: This is super confusing and needs to be refactored.
-
         if (Driver is null)
         {
             return;
         }
 
-        // If we have a SuperView, it'll render our frames.
         if (!SuperViewRendersLineCanvas && LineCanvas.Viewport != Rectangle.Empty)
         {
             foreach (KeyValuePair<Point, Cell?> p in LineCanvas.GetCellMap ())
@@ -556,31 +560,6 @@ public partial class View // Drawing APIs
 
             LineCanvas.Clear ();
         }
-
-        if (Subviews.Any (s => s.SuperViewRendersLineCanvas))
-        {
-            foreach (View subview in Subviews.Where (s => s.SuperViewRendersLineCanvas))
-            {
-                // Combine the LineCanvas'
-                LineCanvas.Merge (subview.LineCanvas);
-                subview.LineCanvas.Clear ();
-            }
-
-            foreach (KeyValuePair<Point, Cell?> p in LineCanvas.GetCellMap ())
-            {
-                // Get the entire map
-                if (p.Value is { })
-                {
-                    SetAttribute (p.Value.Value.Attribute ?? ColorScheme!.Normal);
-                    Driver.Move (p.Key.X, p.Key.Y);
-
-                    // TODO: #2616 - Support combining sequences that don't normalize
-                    Driver.AddRune (p.Value.Value.Rune);
-                }
-            }
-
-            LineCanvas.Clear ();
-        }
     }
 
     #endregion DrawLineCanvas

+ 27 - 23
UICatalog/Scenarios/AllViewsTester.cs

@@ -40,9 +40,12 @@ public class AllViewsTester : Scenario
         {
             Title = GetQuitKeyAndName (),
             ColorScheme = Colors.ColorSchemes ["TopLevel"],
-            BorderStyle = LineStyle.None
         };
 
+        // Set the BorderStyle we use for all subviews, but disable the app border thickness
+        app.Border!.LineStyle = LineStyle.Heavy;
+        app.Border.Thickness = new (0);
+
         _viewClasses = GetAllViewClassesCollection ()
                        .OrderBy (t => t.Name)
                        .Select (t => new KeyValuePair<string, Type> (t.Name, t))
@@ -56,12 +59,11 @@ public class AllViewsTester : Scenario
             Width = Dim.Auto (),
             Height = Dim.Fill (),
             AllowsMarking = false,
-            ColorScheme = Colors.ColorSchemes ["TopLevel"],
             SelectedItem = 0,
             Source = new ListWrapper<string> (new (_viewClasses.Keys.ToList ())),
-            BorderStyle = LineStyle.Rounded,
             SuperViewRendersLineCanvas = true
         };
+        _classListView.Border!.Thickness = new (1);
 
         _classListView.SelectedItemChanged += (s, args) =>
                                               {
@@ -92,57 +94,58 @@ public class AllViewsTester : Scenario
             Y = 0,
             Width = Dim.Auto (),
             Height = Dim.Auto (),
-            ColorScheme = Colors.ColorSchemes ["TopLevel"],
-            BorderStyle = LineStyle.Rounded,
             AutoSelectViewToEdit = false,
             AutoSelectAdornments = false,
-            SuperViewRendersLineCanvas = true
+            SuperViewRendersLineCanvas = true,
         };
-        _adornmentsEditor.ExpanderButton.Orientation = Orientation.Vertical;
+        _adornmentsEditor.Border!.Thickness = new (1);
+        _adornmentsEditor.ExpanderButton!.Orientation = Orientation.Horizontal;
+        _adornmentsEditor.ExpanderButton.Enabled = false;
 
         _arrangementEditor = new ()
         {
             Title = "Arrangement [_3]",
             X = Pos.Right (_classListView) - 1,
-            Y = Pos.Bottom (_adornmentsEditor) -1,
+            Y = Pos.Bottom (_adornmentsEditor) - Pos.Func (() => _adornmentsEditor.Frame.Height == 1 ? 0 : 1),
             Width = Dim.Width (_adornmentsEditor),
             Height = Dim.Fill (),
-            ColorScheme = Colors.ColorSchemes ["TopLevel"],
-            BorderStyle = LineStyle.Rounded,
             AutoSelectViewToEdit = false,
             AutoSelectAdornments = false,
             SuperViewRendersLineCanvas = true
         };
-        _arrangementEditor.ExpanderButton.Orientation = Orientation.Vertical;
+        _arrangementEditor.ExpanderButton!.Orientation = Orientation.Horizontal;
+
+        _arrangementEditor.ExpanderButton.CollapsedChanging += (sender, args) =>
+                                                               {
+                                                                   _adornmentsEditor.ExpanderButton.Collapsed = args.NewValue;
+                                                               };
+        _arrangementEditor.Border!.Thickness = new (1);
 
         _layoutEditor = new ()
         {
             Title = "Layout [_4]",
-            X = Pos.Right (_adornmentsEditor) - 1,
+            X = Pos.Right (_arrangementEditor) - 1,
             Y = 0,
-
             //Width = Dim.Fill (), // set below
             Height = Dim.Auto (),
             CanFocus = true,
-            ColorScheme = Colors.ColorSchemes ["TopLevel"],
-            BorderStyle = LineStyle.Rounded,
             AutoSelectViewToEdit = false,
             AutoSelectAdornments = false,
             SuperViewRendersLineCanvas = true
         };
+        _layoutEditor.Border!.Thickness = new (1);
 
         _settingsPane = new ()
         {
             Title = "Settings [_5]",
             X = Pos.Right (_adornmentsEditor) - 1,
-            Y = Pos.Bottom (_layoutEditor) - 1,
+            Y = Pos.Bottom (_layoutEditor) - Pos.Func (() => _layoutEditor.Frame.Height == 1 ? 0 : 1),
             Width = Dim.Width (_layoutEditor),
             Height = Dim.Auto (),
             CanFocus = true,
-            ColorScheme = Colors.ColorSchemes ["TopLevel"],
-            BorderStyle = LineStyle.Rounded,
             SuperViewRendersLineCanvas = true
         };
+        _settingsPane.Border!.Thickness = new (1, 1, 1, 0);
 
         Label label = new () { X = 0, Y = 0, Text = "_Orientation:" };
 
@@ -191,6 +194,7 @@ public class AllViewsTester : Scenario
             // X = Pos.Right(_layoutEditor),
             SuperViewRendersLineCanvas = true
         };
+        _eventLog.Border.Thickness = new (1);
         _eventLog.X = Pos.AnchorEnd () - 1;
         _eventLog.Y = 0;
 
@@ -217,15 +221,15 @@ public class AllViewsTester : Scenario
         _hostPane = new ()
         {
             Id = "_hostPane",
-            X = Pos.Right (_adornmentsEditor) - 1,
-            Y = Pos.Bottom (_settingsPane) - 1,
-            Width = Dim.Width (_layoutEditor),
+            X = Pos.Right (_adornmentsEditor),
+            Y = Pos.Bottom (_settingsPane),
+            Width = Dim.Width (_layoutEditor) - 2,
             Height = Dim.Fill (),
             CanFocus = true,
             TabStop = TabBehavior.TabStop,
             ColorScheme = Colors.ColorSchemes ["Base"],
-            Arrangement = ViewArrangement.Resizable,
-            BorderStyle = LineStyle.RoundedDotted,
+            Arrangement = ViewArrangement.LeftResizable | ViewArrangement.BottomResizable | ViewArrangement.RightResizable,
+            BorderStyle = LineStyle.Double,
             SuperViewRendersLineCanvas = true
         };
         _hostPane.Border!.ColorScheme = app.ColorScheme;

+ 17 - 9
UICatalog/Scenarios/Editors/AdornmentsEditor.cs

@@ -15,7 +15,7 @@ public class AdornmentsEditor : EditorBase
 
         TabStop = TabBehavior.TabGroup;
 
-        ExpanderButton.Orientation = Orientation.Horizontal;
+        ExpanderButton!.Orientation = Orientation.Horizontal;
 
         Initialized += AdornmentsEditor_Initialized;
     }
@@ -27,7 +27,7 @@ public class AdornmentsEditor : EditorBase
     /// <inheritdoc/>
     protected override void OnViewToEditChanged ()
     {
-        Enabled = ViewToEdit is not Adornment;
+        //Enabled = ViewToEdit is not Adornment;
 
         if (MarginEditor is { })
         {
@@ -93,31 +93,39 @@ public class AdornmentsEditor : EditorBase
     {
         MarginEditor = new ()
         {
-            X = 0,
+            X = -1,
             Y = 0,
-            SuperViewRendersLineCanvas = true
+            SuperViewRendersLineCanvas = true,
+            BorderStyle = LineStyle.Single
         };
+        MarginEditor.Border!.Thickness = MarginEditor.Border.Thickness with { Bottom = 0 };
         Add (MarginEditor);
 
         BorderEditor = new ()
         {
             X = Pos.Left (MarginEditor),
             Y = Pos.Bottom (MarginEditor),
-            SuperViewRendersLineCanvas = true
+            SuperViewRendersLineCanvas = true,
+            BorderStyle = LineStyle.Single
         };
+        BorderEditor.Border!.Thickness = BorderEditor.Border.Thickness with { Bottom = 0 };
         Add (BorderEditor);
 
         PaddingEditor = new ()
         {
             X = Pos.Left (BorderEditor),
             Y = Pos.Bottom (BorderEditor),
-            SuperViewRendersLineCanvas = true
+            SuperViewRendersLineCanvas = true,
+            BorderStyle = LineStyle.Single
         };
+        PaddingEditor.Border!.Thickness = PaddingEditor.Border.Thickness with { Bottom = 0 };
         Add (PaddingEditor);
 
-        MarginEditor.ExpanderButton.Collapsed = true;
-        BorderEditor.ExpanderButton.Collapsed = true;
-        PaddingEditor.ExpanderButton.Collapsed = true;
+        Width = Dim.Auto (maximumContentDim: Dim.Func (() => MarginEditor.Frame.Width - 2));
+
+        MarginEditor.ExpanderButton!.Collapsed = true;
+        BorderEditor.ExpanderButton!.Collapsed = true;
+        PaddingEditor.ExpanderButton!.Collapsed = true;
 
         MarginEditor.AdornmentToEdit = ViewToEdit?.Margin ?? null;
         BorderEditor.AdornmentToEdit = ViewToEdit?.Border ?? null;

+ 1 - 1
UICatalog/Scenarios/Editors/ArrangementEditor.cs

@@ -69,7 +69,7 @@ public sealed class ArrangementEditor : EditorBase
 
     protected override void OnViewToEditChanged ()
     {
-        Enabled = ViewToEdit is not Adornment;
+        _arrangementSlider.Enabled = ViewToEdit is not Adornment;
 
         _arrangementSlider.OptionsChanged -= ArrangementSliderOnOptionsChanged;
 

+ 2 - 0
UICatalog/Scenarios/Editors/DimEditor.cs

@@ -24,6 +24,8 @@ public class DimEditor : EditorBase
 
     protected override void OnUpdateSettings ()
     {
+        Enabled = ViewToEdit is not Adornment;
+
         if (ViewToEdit is null)
         {
             return;

+ 37 - 13
UICatalog/Scenarios/Editors/EditorBase.cs

@@ -1,4 +1,5 @@
-using System;
+#nullable enable
+using System;
 using System.Diagnostics;
 using System.Linq;
 using Terminal.Gui;
@@ -9,8 +10,6 @@ public abstract class EditorBase : View
 {
     protected EditorBase ()
     {
-        BorderStyle = LineStyle.Rounded;
-
         Width = Dim.Auto (DimAutoStyle.Content);
         Height = Dim.Auto (DimAutoStyle.Content);
 
@@ -26,9 +25,21 @@ public abstract class EditorBase : View
 
         Initialized += OnInitialized;
 
-        void OnInitialized (object sender, EventArgs e)
+        void OnInitialized (object? sender, EventArgs e)
         {
-            Border?.Add (ExpanderButton!);
+            if (Border is { })
+            {
+                Border.Add (ExpanderButton);
+
+                if (ExpanderButton.Orientation == Orientation.Vertical)
+                {
+                    ExpanderButton.X = Pos.AnchorEnd () - 1;
+                }
+                else
+                {
+                    ExpanderButton.Y = Pos.AnchorEnd () - 1;
+                }
+            }
 
             Application.MouseEvent += ApplicationOnMouseEvent;
             Application.Navigation!.FocusedChanged += NavigationOnFocusedChanged;
@@ -39,11 +50,24 @@ public abstract class EditorBase : View
 
     }
 
-    public ExpanderButton ExpanderButton {get; set; }
+    private readonly ExpanderButton? _expanderButton;
+
+    public ExpanderButton? ExpanderButton
+    {
+        get => _expanderButton;
+        init
+        {
+            if (_expanderButton == value)
+            {
+                return;
+            }
+            _expanderButton = value;
+        }
+    }
 
     public bool UpdatingSettings { get; private set; } = false;
 
-    private void View_LayoutComplete (object sender, LayoutEventArgs e)
+    private void View_LayoutComplete (object? sender, LayoutEventArgs e)
     {
         UpdatingSettings = true;
 
@@ -53,9 +77,9 @@ public abstract class EditorBase : View
     }
 
 
-    private View _viewToEdit;
+    private View? _viewToEdit;
 
-    public View ViewToEdit
+    public View? ViewToEdit
     {
         get => _viewToEdit;
         set
@@ -95,7 +119,7 @@ public abstract class EditorBase : View
     /// <summary>
     ///     Gets or sets the View that will scope the behavior of <see cref="AutoSelectViewToEdit"/>.
     /// </summary>
-    public View AutoSelectSuperView { get; set; }
+    public View? AutoSelectSuperView { get; set; }
 
     /// <summary>
     ///     Gets or sets whether auto select with the mouse will select Adornments or just Views.
@@ -103,7 +127,7 @@ public abstract class EditorBase : View
     public bool AutoSelectAdornments { get; set; }
 
 
-    private void NavigationOnFocusedChanged (object sender, EventArgs e)
+    private void NavigationOnFocusedChanged (object? sender, EventArgs e)
     {
         if (AutoSelectSuperView is null)
         {
@@ -123,7 +147,7 @@ public abstract class EditorBase : View
         ViewToEdit = Application.Navigation!.GetFocused ();
     }
 
-    private void ApplicationOnMouseEvent (object sender, MouseEventArgs e)
+    private void ApplicationOnMouseEvent (object? sender, MouseEventArgs e)
     {
         if (e.Flags != MouseFlags.Button1Clicked || !AutoSelectViewToEdit)
         {
@@ -136,7 +160,7 @@ public abstract class EditorBase : View
             return;
         }
 
-        View view = e.View;
+        View? view = e.View;
 
         if (view is null)
         {

+ 0 - 2
UICatalog/Scenarios/Editors/EventLog.cs

@@ -31,8 +31,6 @@ public class EventLog : ListView
         };
 
         Initialized += EventLog_Initialized;
-
-        BorderStyle = LineStyle.Dotted;
     }
     public ExpanderButton? ExpandButton { get; }
 

+ 34 - 1
UICatalog/Scenarios/Editors/ExpanderButton.cs

@@ -47,6 +47,35 @@ public class ExpanderButton : Button
         HighlightStyle = HighlightStyle.None;
 
         Initialized += ExpanderButton_Initialized;
+
+        EnabledChanged += (sender, args) =>
+                          {
+                              ShowHide ();
+                          };
+    }
+
+    private void ShowHide ()
+    {
+        if (!Enabled)
+        {
+            Visible = false;
+        }
+
+        if (SuperView is Border { } border)
+        {
+            switch (Orientation)
+            {
+                case Orientation.Vertical:
+                    Visible = border.Thickness.Top > 0;
+
+                    break;
+
+                case Orientation.Horizontal:
+                    Visible = border.Border?.Thickness.Left > 0;
+
+                    break;
+            }
+        }
     }
 
     private void ExpanderButton_Initialized (object? sender, EventArgs e)
@@ -54,6 +83,11 @@ public class ExpanderButton : Button
         ShadowStyle = ShadowStyle.None;
 
         ExpandOrCollapse (Collapsed);
+
+        if (SuperView is Border { } border)
+        {
+            border.ThicknessChanged += (o, args) => ShowHide ();
+        }
     }
 
     private Orientation _orientation = Orientation.Horizontal;
@@ -219,7 +253,6 @@ public class ExpanderButton : Button
         foreach (View subview in superView.Subviews)
         {
             subview.Visible = !Collapsed;
-            subview.Enabled = !Collapsed;
         }
     }
 }

+ 0 - 4
UICatalog/Scenarios/Editors/LayoutEditor.cs

@@ -16,8 +16,6 @@ public class LayoutEditor : EditorBase
         Title = "_LayoutEditor";
         CanFocus = true;
 
-        BorderStyle = LineStyle.Rounded;
-
         Initialized += LayoutEditor_Initialized;
     }
 
@@ -29,8 +27,6 @@ public class LayoutEditor : EditorBase
 
     protected override void OnViewToEditChanged ()
     {
-        Enabled = ViewToEdit is not Adornment;
-
         if (_xEditor is { })
         {
             _xEditor.ViewToEdit = ViewToEdit;

+ 1 - 1
UICatalog/Scenarios/Editors/MarginEditor.cs

@@ -32,7 +32,7 @@ public class MarginEditor : AdornmentEditor
 
             SuperViewRendersLineCanvas = true,
             Title = "_Shadow",
-            BorderStyle = LineStyle.Dashed,
+            BorderStyle = LineStyle.Single,
             RadioLabels = Enum.GetNames (typeof (ShadowStyle)),
         };
 

+ 34 - 27
UICatalog/Scenarios/Editors/PosEditor.cs

@@ -23,16 +23,17 @@ public class PosEditor : EditorBase
     private RadioGroup? _posRadioGroup;
     private TextField? _valueEdit;
 
-
-
     protected override void OnUpdateSettings ()
     {
+        Enabled = ViewToEdit is not Adornment;
+
         if (ViewToEdit is null)
         {
             return;
         }
 
         Pos? pos;
+
         if (Dimension == Dimension.Width)
         {
             pos = ViewToEdit.X;
@@ -53,25 +54,30 @@ public class PosEditor : EditorBase
         }
 
         _valueEdit!.Enabled = false;
+
         switch (pos)
         {
             case PosPercent percent:
                 _valueEdit.Enabled = true;
                 _value = percent.Percent;
                 _valueEdit!.Text = _value.ToString ();
+
                 break;
             case PosAbsolute absolute:
                 _valueEdit.Enabled = true;
                 _value = absolute.Position;
                 _valueEdit!.Text = _value.ToString ();
+
                 break;
             case PosFunc func:
                 _valueEdit.Enabled = true;
                 _value = func.Fn ();
                 _valueEdit!.Text = _value.ToString ();
+
                 break;
             default:
                 _valueEdit!.Text = pos.ToString ();
+
                 break;
         }
     }
@@ -88,6 +94,7 @@ public class PosEditor : EditorBase
         Add (label);
         _posRadioGroup = new () { X = 0, Y = Pos.Bottom (label), RadioLabels = _radioItems };
         _posRadioGroup.SelectedItemChanged += OnRadioGroupOnSelectedItemChanged;
+
         _valueEdit = new ()
         {
             X = Pos.Right (label) + 1,
@@ -97,29 +104,29 @@ public class PosEditor : EditorBase
         };
 
         _valueEdit.Accepting += (s, args) =>
-        {
-            try
-            {
-                _value = int.Parse (_valueEdit.Text);
-                PosChanged ();
-            }
-            catch
-            {
-                // ignored
-            }
-            args.Cancel = true;
-        };
+                                {
+                                    try
+                                    {
+                                        _value = int.Parse (_valueEdit.Text);
+                                        PosChanged ();
+                                    }
+                                    catch
+                                    {
+                                        // ignored
+                                    }
+
+                                    args.Cancel = true;
+                                };
         Add (_valueEdit);
 
         Add (_posRadioGroup);
-
     }
 
     private void OnRadioGroupOnSelectedItemChanged (object? s, SelectedItemChangedArgs selected) { PosChanged (); }
 
     // These need to have same order 
-    private readonly List<string> _posNames = ["Absolute", "Align", "AnchorEnd", "Center", "Func", "Percent",];
-    private readonly string [] _radioItems = ["Absolute(n)", "Align", "AnchorEnd", "Center", "Func(()=>n)", "Percent(n)",];
+    private readonly List<string> _posNames = ["Absolute", "Align", "AnchorEnd", "Center", "Func", "Percent"];
+    private readonly string [] _radioItems = ["Absolute(n)", "Align", "AnchorEnd", "Center", "Func(()=>n)", "Percent(n)"];
 
     private void PosChanged ()
     {
@@ -131,15 +138,15 @@ public class PosEditor : EditorBase
         try
         {
             Pos? pos = _posRadioGroup!.SelectedItem switch
-            {
-                0 => Pos.Absolute (_value),
-                1 => Pos.Align (Alignment.Start),
-                2 => new PosAnchorEnd (),
-                3 => Pos.Center (),
-                4 => Pos.Func (() => _value),
-                5 => Pos.Percent (_value),
-                _ => Dimension == Dimension.Width ? ViewToEdit.X : ViewToEdit.Y
-            };
+                       {
+                           0 => Pos.Absolute (_value),
+                           1 => Pos.Align (Alignment.Start),
+                           2 => new PosAnchorEnd (),
+                           3 => Pos.Center (),
+                           4 => Pos.Func (() => _value),
+                           5 => Pos.Percent (_value),
+                           _ => Dimension == Dimension.Width ? ViewToEdit.X : ViewToEdit.Y
+                       };
 
             if (Dimension == Dimension.Width)
             {
@@ -149,8 +156,8 @@ public class PosEditor : EditorBase
             {
                 ViewToEdit.Y = pos;
             }
-            SetNeedsLayout ();
 
+            SetNeedsLayout ();
         }
         catch (Exception e)
         {

+ 64 - 64
UICatalog/Scenarios/LineCanvasExperiment.cs

@@ -14,7 +14,8 @@ public class LineCanvasExperiment : Scenario
 
         Window app = new ()
         {
-            Title = GetQuitKeyAndName ()
+            Title = GetQuitKeyAndName (),
+            BorderStyle = LineStyle.None
         };
 
         var frame1 = new FrameView
@@ -25,8 +26,10 @@ public class LineCanvasExperiment : Scenario
             Width = Dim.Fill (),
             Height = Dim.Fill (),
             ColorScheme = Colors.ColorSchemes ["Base"]
+           ,
+            SuperViewRendersLineCanvas = true
         };
-        frame1.BorderStyle = LineStyle.Double;
+        frame1.BorderStyle = LineStyle.None;
 
         //View.Diagnostics ^= DiagnosticFlags.FrameRuler;
 
@@ -35,23 +38,21 @@ public class LineCanvasExperiment : Scenario
         var win1 = new Window
         {
             Title = "win1",
-            Text = "Win1 30%/50% Heavy",
-            X = 20,
+            Text = "Win1 - 0,0",
+            X = 0,
             Y = 0,
-            Width = 30, //Dim.Percent (30) - 5,
-            Height = 10, //Dim.Percent (50) - 5,
-            //ColorScheme = Colors.ColorSchemes ["Base"],
-            BorderStyle = LineStyle.Heavy,
+            Width = 30,
+            Height = 10,
+            //BorderStyle = LineStyle.Heavy,
             SuperViewRendersLineCanvas = true
         };
-        win1.Padding.Thickness = new (1);
 
         frame1.Add (win1);
 
         var win2 = new Window
         {
             Title = "win2",
-            Text = "Win2 right of win1, 30%/70% Single.",
+            Text = "Win2 right of win1",
             X = Pos.Right (win1) - 1,
             Y = 0,
             Width = Dim.Percent (30),
@@ -61,81 +62,80 @@ public class LineCanvasExperiment : Scenario
             SuperViewRendersLineCanvas = true
         };
 
-        frame1.Add (win2);
 
-        var view3 = new FrameView
+        var subViewOfWin2 = new FrameView
         {
-            Title = "View 3",
-            Text = "View3 right of win2 Fill/Fill Single",
-            X = Pos.Right (win2) - 1,
+            Title = "subViewOfWin2",
+            X = 0,
             Y = 0,
-            Width = Dim.Fill (-1),
-            Height = Dim.Fill (-1),
+            Width = Dim.Fill (),
+            Height = Dim.Fill (),
             SuperViewRendersLineCanvas = true
 
             //ColorScheme = Colors.ColorSchemes ["Menu"],
         };
 
-        frame1.Add (view3);
+        win2.Add (subViewOfWin2);
+
+        frame1.Add (win2);
+
 
         var view4 = new FrameView
         {
             Title = "View 4",
             Text = "View4 below win2 win2.Width/5 Single",
-            X = Pos.Left (win2),
+            X = Pos.Right (win1) - 1,
             Y = Pos.Bottom (win2) - 1,
             Width = win2.Width,
             Height = 5,
             SuperViewRendersLineCanvas = true
-
-            //ColorScheme = Colors.ColorSchemes ["TopLevel"],
         };
 
         frame1.Add (view4);
 
-        var win5 = new Window
-        {
-            Title = "Win 5",
-            Text = "win5 below View4 view4.Width/5 Double",
-            X = Pos.Left (win2),
-            Y = Pos.Bottom (view4) - 1,
-            Width = view4.Width,
-            Height = 5,
-
-            //ColorScheme = Colors.ColorSchemes ["TopLevel"],
-            SuperViewRendersLineCanvas = true,
-            BorderStyle = LineStyle.Double
-        };
-
-        frame1.Add (win5);
-
-        var line = new Line
-        {
-            X = 1,
-            Y = 1,
-            Width = 10,
-            Height = 1,
-            Orientation = Orientation.Horizontal,
-            SuperViewRendersLineCanvas = true
-        };
-        frame1.Add (line);
-
-        var marginWindow = new Window
-        {
-            Title = "Positive Margin",
-            X = 0,
-            Y = 8,
-            Width = 25,
-            Height = 10,
-
-            //ColorScheme = Colors.ColorSchemes ["Error"],
-            SuperViewRendersLineCanvas = true
-        };
-        marginWindow.Margin.ColorScheme = Colors.ColorSchemes ["Error"];
-        marginWindow.Margin.Thickness = new (1);
-        marginWindow.Border.Thickness = new (1, 2, 1, 1);
-
-        frame1.Add (marginWindow);
+        //var win5 = new Window
+        //{
+        //    Title = "Win 5",
+        //    Text = "win5 below View4 view4.Width/5 Double",
+        //    X = Pos.Left (win2),
+        //    Y = Pos.Bottom (view4) - 1,
+        //    Width = view4.Width,
+        //    Height = 5,
+
+        //    //ColorScheme = Colors.ColorSchemes ["TopLevel"],
+        //    SuperViewRendersLineCanvas = true,
+        //    BorderStyle = LineStyle.Double
+        //};
+
+        //frame1.Add (win5);
+
+        //var line = new Line
+        //{
+        //    X = 1,
+        //    Y = 1,
+        //    Width = 10,
+        //    Height = 1,
+        //    Orientation = Orientation.Horizontal,
+        //    SuperViewRendersLineCanvas = true
+        //};
+        //frame1.Add (line);
+
+        //var marginWindow = new Window
+        //{
+        //    Title = "Positive Margin",
+        //    X = 0,
+        //    Y = 8,
+        //    Width = 25,
+        //    Height = 10,
+
+        //    //ColorScheme = Colors.ColorSchemes ["Error"],
+        //    SuperViewRendersLineCanvas = true
+        //};
+        //marginWindow.Margin.ColorScheme = Colors.ColorSchemes ["Error"];
+        //marginWindow.Margin.Thickness = new (1);
+        //marginWindow.Border.Thickness = new (1, 2, 1, 1);
+
+        //frame1.Add (marginWindow);
 
         Application.Run (app);
         app.Dispose ();

+ 6 - 6
UnitTests/View/Adornment/BorderTests.cs

@@ -830,11 +830,11 @@ public class BorderTests (ITestOutputHelper output)
 │ ┊ │
 └───┘")]
     [InlineData (true, @"
-╔═─┐
+╔═─┐
 ║ ║ │
-╚═╬┄┐
+╠═╬┄┤
 │ ┊ ┊
-└─┄┘")]
+└─┄┘")]
     [SetupFakeDriver]
     public void SuperViewRendersLineCanvas_No_Subviews_AutoJoinsLines (bool superViewRendersLineCanvas, string expected)
     {
@@ -888,13 +888,13 @@ public class BorderTests (ITestOutputHelper output)
 │    ┊    │
 └─────────┘")]
     [InlineData (true, @"
-╔╡A╞═────┐
+╔╡A╞═────┐
 ║    ║    │
 ║    ║    │
-╚════╬┤C├┄┐
+╠════╬┤C├┄┤
 │    ┊    ┊
 │    ┊    ┊
-└────┄┄┄┄┘")]
+└────┄┄┄┄┘")]
     [SetupFakeDriver]
     public void SuperViewRendersLineCanvas_Title_AutoJoinsLines (bool superViewRendersLineCanvas, string expected)
     {