From bf7e251c9b648dda820165ba6c728c464dd67b5a Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 3 Jan 2023 20:02:35 +0000 Subject: [PATCH] Fix CanFocus to true and sort control positions --- Terminal.Gui/Views/SplitContainer.cs | 2 +- UICatalog/Scenarios/SplitContainerExample.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Terminal.Gui/Views/SplitContainer.cs b/Terminal.Gui/Views/SplitContainer.cs index 10994eb17..2c9733d95 100644 --- a/Terminal.Gui/Views/SplitContainer.cs +++ b/Terminal.Gui/Views/SplitContainer.cs @@ -31,7 +31,7 @@ namespace Terminal.Gui { LayoutStarted += (e) => Setup (); - CanFocus = false; + CanFocus = true; } /// diff --git a/UICatalog/Scenarios/SplitContainerExample.cs b/UICatalog/Scenarios/SplitContainerExample.cs index 5b8f6e263..1facd677a 100644 --- a/UICatalog/Scenarios/SplitContainerExample.cs +++ b/UICatalog/Scenarios/SplitContainerExample.cs @@ -48,8 +48,8 @@ namespace UICatalog.Scenarios { Label lbl1; splitContainer.Panels [0].Title = "Hello"; - splitContainer.Panels [0].Add (lbl1 = new Label ("Type Something:") { Y = 1 }); - splitContainer.Panels [0].Add (new TextField () { Width = Dim.Fill (), Y = 1, X = Pos.Right (lbl1) + 1 }); + splitContainer.Panels [0].Add (lbl1 = new Label ("Type Something:") { Y = 0 }); + splitContainer.Panels [0].Add (new TextField () { Width = Dim.Fill (), Y = 0, X = Pos.Right (lbl1) + 1 }); Label lbl2; splitContainer.Panels [1].Title = "World"; @@ -65,11 +65,12 @@ namespace UICatalog.Scenarios { }); splitContainer2.Border.BorderStyle = BorderStyle.None; + splitContainer2.Border.DrawMarginFrame = false; - splitContainer2.Panels [1].Add (lbl2 = new Label ("Type Here Too:") { Y = 1 }); - splitContainer2.Panels [1].Add (new TextField () { Width = Dim.Fill (), Y = 1, X = Pos.Right (lbl2) + 1 }); - splitContainer2.Panels [1].Add (new Label ("Here is a Text box:") { Y = 3 }); - splitContainer2.Panels [1].Add (new TextView () { Y = 4, Width = Dim.Fill (), Height = Dim.Fill (), AllowsTab = false }); + splitContainer2.Panels [1].Add (lbl2 = new Label ("Type Here Too:") { Y = 0 }); + splitContainer2.Panels [1].Add (new TextField () { Width = Dim.Fill (), Y = 0, X = Pos.Right (lbl2) + 1 }); + splitContainer2.Panels [1].Add (new Label ("Here is a Text box:") { Y = 1 }); + splitContainer2.Panels [1].Add (new TextView () { Y = 2, Width = Dim.Fill (), Height = Dim.Fill (), AllowsTab = false }); Win.Add (splitContainer);