@@ -13,7 +13,6 @@ namespace QuickNavigate.Forms
1313{
1414 public sealed partial class QuickOutlineForm : QuickForm
1515 {
16- [ NotNull ] readonly Settings settings ;
1716 readonly ContextMenuStrip contextMenu = new ContextMenuStrip { Renderer = new DockPanelStripRenderer ( false ) } ;
1817 readonly ContextMenu inputEmptyContextMenu = new ContextMenu ( ) ;
1918 readonly List < Button > filters = new List < Button > ( ) ;
@@ -28,13 +27,11 @@ public sealed partial class QuickOutlineForm : QuickForm
2827 /// <param name="inFile"></param>
2928 /// <param name="inClass"></param>
3029 /// <param name="settings"></param>
31- public QuickOutlineForm ( [ NotNull ] FileModel inFile , [ CanBeNull ] ClassModel inClass , [ NotNull ] Settings settings )
30+ public QuickOutlineForm ( [ NotNull ] FileModel inFile , [ CanBeNull ] ClassModel inClass , [ NotNull ] Settings settings ) : base ( settings )
3231 {
3332 InFile = inFile ;
3433 InClass = inClass ?? ClassModel . VoidClass ;
35- this . settings = settings ;
3634 InitializeComponent ( ) ;
37- if ( settings . QuickOutlineSize . Width > MinimumSize . Width ) Size = settings . QuickOutlineSize ;
3835 InitializeTree ( ) ;
3936 InitializeTheme ( ) ;
4037 RefreshTree ( ) ;
@@ -228,6 +225,12 @@ void RefreshFilterTip(Button filter)
228225
229226 #region Event Handlers
230227
228+ protected override void OnShown ( EventArgs e )
229+ {
230+ base . OnShown ( e ) ;
231+ if ( Settings != null && Settings . QuickOutlineSize . Width > MinimumSize . Width ) Size = Settings . QuickOutlineSize ;
232+ }
233+
231234 protected override void OnKeyDown ( KeyEventArgs e )
232235 {
233236 var keyCode = e . KeyCode ;
@@ -259,7 +262,7 @@ protected override void OnKeyDown(KeyEventArgs e)
259262 }
260263 }
261264
262- protected override void OnFormClosing ( FormClosingEventArgs e ) => settings . QuickOutlineSize = Size ;
265+ protected override void OnFormClosing ( FormClosingEventArgs e ) => Settings . QuickOutlineSize = Size ;
263266
264267 void OnInputTextChanged ( object sender , EventArgs e ) => RefreshTree ( ) ;
265268
0 commit comments