From 2c91cca1b481b6904179df426136a54a90c6a4d7 Mon Sep 17 00:00:00 2001 From: Saas Date: Thu, 14 May 2026 19:51:23 +0200 Subject: [PATCH 1/2] auto scroll the content panel navigation bar to the current folder --- Source/Editor/Windows/ContentWindow.Navigation.cs | 11 +++++++++++ Source/Editor/Windows/ContentWindow.cs | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/Source/Editor/Windows/ContentWindow.Navigation.cs b/Source/Editor/Windows/ContentWindow.Navigation.cs index 4c7373aa6..265f9d524 100644 --- a/Source/Editor/Windows/ContentWindow.Navigation.cs +++ b/Source/Editor/Windows/ContentWindow.Navigation.cs @@ -257,6 +257,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 5a73530bc..7014732ac 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -1774,6 +1774,14 @@ namespace FlaxEditor.Windows return base.OnMouseUp(location, button); } + /// + protected override void OnSizeChanged() + { + base.OnSizeChanged(); + + ScrollNavigationBarToCurrentFolder(); + } + /// protected override void PerformLayoutBeforeChildren() { From e6d981036dd75290754242252455c9743a2d25c8 Mon Sep 17 00:00:00 2001 From: Saas Date: Thu, 14 May 2026 23:41:41 +0200 Subject: [PATCH 2/2] scroll on editor start --- Source/Editor/Windows/ContentWindow.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 7014732ac..42bbb8f27 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -559,7 +559,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) @@ -571,7 +571,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) @@ -1555,6 +1555,7 @@ namespace FlaxEditor.Windows PerformLayout(); } UpdateViewDropdownBounds(); + ScrollNavigationBarToCurrentFolder(); } }