diff --git a/Source/Editor/Windows/ContentWindow.Navigation.cs b/Source/Editor/Windows/ContentWindow.Navigation.cs index 27826e195..548f927c5 100644 --- a/Source/Editor/Windows/ContentWindow.Navigation.cs +++ b/Source/Editor/Windows/ContentWindow.Navigation.cs @@ -229,6 +229,17 @@ namespace FlaxEditor.Windows _navigationBar.IsLayoutLocked = wasLayoutLocked; _navigationBar.PerformLayout(); UpdateNavigationBarBounds(); + + ScrollNavigationBarToCurrentFolder(); + } + + private void ScrollNavigationBarToCurrentFolder() + { + if (_navigationBar != null && _navigationBar.ChildrenCount != 0 && _navigationBar.HScrollBar.Visible) + { + _navigationBar.HScrollBar.TargetValue = _navigationBar.HScrollBar.Maximum; + _navigationBar.HScrollBar.FastScroll(); + } } /// diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index eca4e5be6..a741da084 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -561,7 +561,7 @@ namespace FlaxEditor.Windows } /// - /// Enables or disables vertical and horizontal scrolling on the content tree panel + /// Enables or disables vertical and horizontal scrolling on the content tree panel /// /// The state to set scrolling to public void ScrollingOnTreeView(bool enabled) @@ -573,7 +573,7 @@ namespace FlaxEditor.Windows } /// - /// Enables or disables vertical and horizontal scrolling on the content view panel + /// Enables or disables vertical and horizontal scrolling on the content view panel /// /// The state to set scrolling to public void ScrollingOnContentView(bool enabled) @@ -1572,6 +1572,7 @@ namespace FlaxEditor.Windows PerformLayout(); } UpdateViewDropdownBounds(); + ScrollNavigationBarToCurrentFolder(); } } @@ -1852,6 +1853,14 @@ namespace FlaxEditor.Windows return base.OnMouseUp(location, button); } + /// + protected override void OnSizeChanged() + { + base.OnSizeChanged(); + + ScrollNavigationBarToCurrentFolder(); + } + /// protected override void PerformLayoutAfterChildren() {