diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 55592d8ce..bfd207aa7 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -495,7 +495,7 @@ public class ComboBox : View, IDesignable Reset (true); _listview.Clear (); _listview.TabStop = TabBehavior.NoStop; - SuperView?.MoveSubviewToEnd (this); + SuperView?.MoveSubviewToStart (this); Rectangle rect = _listview.ViewportToScreen (_listview.IsInitialized ? _listview.Viewport : Rectangle.Empty); SuperView?.SetNeedsDisplay (rect); OnCollapsed (); diff --git a/Terminal.Gui/Views/FileDialog.cs b/Terminal.Gui/Views/FileDialog.cs index 62ad9e494..c5eb48a45 100644 --- a/Terminal.Gui/Views/FileDialog.cs +++ b/Terminal.Gui/Views/FileDialog.cs @@ -543,7 +543,7 @@ public class FileDialog : Dialog { _btnCancel.X = Pos.Func (CalculateOkButtonPosX); _btnOk.X = Pos.Right (_btnCancel) + 1; - MoveSubviewTowardsFront (_btnCancel); + MoveSubviewTowardsStart (_btnCancel); } LayoutSubviews (); } diff --git a/Terminal.Gui/Views/TabView.cs b/Terminal.Gui/Views/TabView.cs index aaeb34069..e435cce71 100644 --- a/Terminal.Gui/Views/TabView.cs +++ b/Terminal.Gui/Views/TabView.cs @@ -1348,7 +1348,7 @@ public class TabView : View _leftScrollIndicator.Visible = true; // Ensures this is clicked instead of the first tab - MoveSubviewToStart (_leftScrollIndicator); + MoveSubviewToEnd (_leftScrollIndicator); _leftScrollIndicator.Draw (); } else diff --git a/UnitTests/View/SubviewTests.cs b/UnitTests/View/SubviewTests.cs index 692678ab1..2ff550296 100644 --- a/UnitTests/View/SubviewTests.cs +++ b/UnitTests/View/SubviewTests.cs @@ -426,14 +426,14 @@ public class SubviewTests superView.Add (subview1, subview2, subview3); - superView.MoveSubviewTowardsFront (subview2); + superView.MoveSubviewTowardsStart (subview2); Assert.Equal (subview2, superView.Subviews [0]); - superView.MoveSubviewTowardsFront (subview3); + superView.MoveSubviewTowardsStart (subview3); Assert.Equal (subview3, superView.Subviews [1]); // Already at front, what happens? - superView.MoveSubviewTowardsFront (subview2); + superView.MoveSubviewTowardsStart (subview2); Assert.Equal (subview2, superView.Subviews [0]); } diff --git a/docfx/docs/migratingfromv1.md b/docfx/docs/migratingfromv1.md index 8aab789e5..3b7c446a9 100644 --- a/docfx/docs/migratingfromv1.md +++ b/docfx/docs/migratingfromv1.md @@ -250,7 +250,7 @@ See also [Keyboard](keyboard.md) where HotKey is covered more deeply... - `public bool FocusDeepest (NavigationDirection direction, TabBehavior? behavior)` * In v1, the `View.OnEnter/Enter` and `View.OnLeave/Leave` virtual methods/events could be used to notify that a view had gained or lost focus, but had confusing semantics around what it mean to override (requiring calling `base`) and bug-ridden behavior on what the return values signified. The "Enter" and "Leave" terminology was confusing. In v2, `View.OnHasFocusChanging/HasFocusChanging` and `View.OnHasFocusChanged/HasFocusChanged` replace `View.OnEnter/Enter` and `View.OnLeave/Leave`. These virtual methods/events follow standard Terminal.Gui event patterns. The `View.OnHasFocusChanging/HasFocusChanging` event supports being cancelled. * In v1, the concept of `Mdi` views included a large amount of complex code (in `Toplevel` and `Application`) for dealing with navigation across overlapped Views. This has all been radically simplified in v2. Any View can work in an "overlapped" or "tiled" way. See [navigation.md](navigation.md) for more details. -* The `View.TabIndex` and `View.TabIndexes` have been removed. Change the order of the views in `View.Subviews` to change the navigation order. +* The `View.TabIndex` and `View.TabIndexes` have been removed. Change the order of the views in `View.Subviews` to change the navigation order (using, for example `View.MoveSubviewTowardsStart()`). ### How to Fix (Focus API)