From 7c0dfa02c12fb18529c7f88e5aa45a74e3fb270c Mon Sep 17 00:00:00 2001 From: tznind Date: Tue, 8 Oct 2024 13:23:37 +0100 Subject: [PATCH] Update dependencies only to 2329 - Causes unit test errors --- Showcase/Showcase.csproj | 2 +- src/DesignState.cs | 10 ++++++++-- src/TerminalGuiDesigner.csproj | 6 ++++-- src/UI/Windows/BigListBox.cs | 4 ++-- src/UI/Windows/DimEditor.cs | 2 +- src/UI/Windows/PosEditor.cs | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Showcase/Showcase.csproj b/Showcase/Showcase.csproj index 41aa7203..13b4288c 100644 --- a/Showcase/Showcase.csproj +++ b/Showcase/Showcase.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/DesignState.cs b/src/DesignState.cs index 22c2c411..9baba70e 100644 --- a/src/DesignState.cs +++ b/src/DesignState.cs @@ -23,7 +23,7 @@ public DesignState(Design design) this.Design = design; this.OriginalScheme = this.Design.View.GetExplicitColorScheme(); this.Design.View.DrawContentComplete += this.DrawContentComplete; - this.Design.View.Enter += this.Enter; + this.Design.View.HasFocusChanged += this.FocusChanged; } /// @@ -39,8 +39,14 @@ public DesignState(Design design) /// public Design Design { get; } - private void Enter(object? sender, FocusEventArgs obj) + private void FocusChanged(object? sender, HasFocusEventArgs obj) { + if (!obj.NewValue) + { + // not an Enter event so ignore + return; + } + // when tabbing or clicking into this View when nothing complicated is going on (e.g. Ctrl+Click multi select) if (SelectionManager.Instance.Selected.Count <= 1) { diff --git a/src/TerminalGuiDesigner.csproj b/src/TerminalGuiDesigner.csproj index 730d58b9..9257521a 100644 --- a/src/TerminalGuiDesigner.csproj +++ b/src/TerminalGuiDesigner.csproj @@ -20,7 +20,7 @@ ./nupkg enable TerminalGuiDesigner - 2.0.0-alpha.2203 + 2.0.0-alpha.2239 Thomas Nind enable MIT @@ -33,6 +33,8 @@ logo.png README.md + 2.0.0-alpha.2329 + * Update to latest alpha package 2.0.0-alpha.2203 * True color `ColorPicker` 2.0.0-alpha.2189 @@ -150,7 +152,7 @@ - + diff --git a/src/UI/Windows/BigListBox.cs b/src/UI/Windows/BigListBox.cs index aabb9429..0f6b5b4b 100644 --- a/src/UI/Windows/BigListBox.cs +++ b/src/UI/Windows/BigListBox.cs @@ -164,7 +164,7 @@ public BigListBox( this.callback = Application.AddTimeout(TimeSpan.FromMilliseconds(100), this.Timer); - this.listView.FocusFirst(TabBehavior.TabStop); + this.listView.SetFocus(); } @@ -221,7 +221,7 @@ private void ListView_KeyPress(object? sender, Key key) // backspace or letter/numbers if (key == Key.Backspace || char.IsLetterOrDigit(c)) { - this.searchBox?.FocusFirst(TabBehavior.TabStop); + this.searchBox?.SetFocus(); this.searchBox?.NewKeyDownEvent(key); key.Handled = true; } diff --git a/src/UI/Windows/DimEditor.cs b/src/UI/Windows/DimEditor.cs index 3ac81a44..077b3279 100644 --- a/src/UI/Windows/DimEditor.cs +++ b/src/UI/Windows/DimEditor.cs @@ -88,7 +88,7 @@ private void RgDimType_KeyPress(object sender, Key obj) // if user types in some text change the focus to the text box to enable entering digits if ((obj == Key.Backspace || char.IsDigit(c)) && tbValue.Visible) { - tbValue?.FocusFirst(TabBehavior.TabStop); + tbValue?.SetFocus(); } } diff --git a/src/UI/Windows/PosEditor.cs b/src/UI/Windows/PosEditor.cs index 7b65d2b9..fd110ae9 100644 --- a/src/UI/Windows/PosEditor.cs +++ b/src/UI/Windows/PosEditor.cs @@ -104,7 +104,7 @@ private void RgPosType_KeyPress(object sender, Key key) // if user types in some text change the focus to the text box to enable entering digits if ((key == Key.Backspace || char.IsDigit(c)) && tbValue.Visible) { - tbValue?.FocusFirst(TabBehavior.TabStop); + tbValue?.SetFocus(); } }