Skip to content

Commit

Permalink
Merged hotfix/QuickOutline_size into master
Browse files Browse the repository at this point in the history
  • Loading branch information
slavara committed Jul 27, 2016
2 parents 1a53373 + 0045bed commit f77a0cb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions QuickNavigate/Forms/QuickOutlineForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace QuickNavigate.Forms
{
public sealed partial class QuickOutlineForm : QuickForm
{
[NotNull] readonly Settings settings;
readonly ContextMenuStrip contextMenu = new ContextMenuStrip { Renderer = new DockPanelStripRenderer(false) };
readonly ContextMenu inputEmptyContextMenu = new ContextMenu();
readonly List<Button> filters = new List<Button>();
Expand All @@ -28,13 +27,11 @@ public sealed partial class QuickOutlineForm : QuickForm
/// <param name="inFile"></param>
/// <param name="inClass"></param>
/// <param name="settings"></param>
public QuickOutlineForm([NotNull] FileModel inFile, [CanBeNull] ClassModel inClass, [NotNull] Settings settings)
public QuickOutlineForm([NotNull] FileModel inFile, [CanBeNull] ClassModel inClass, [NotNull] Settings settings) : base(settings)
{
InFile = inFile;
InClass = inClass ?? ClassModel.VoidClass;
this.settings = settings;
InitializeComponent();
if (settings.QuickOutlineSize.Width > MinimumSize.Width) Size = settings.QuickOutlineSize;
InitializeTree();
InitializeTheme();
RefreshTree();
Expand Down Expand Up @@ -228,6 +225,12 @@ void RefreshFilterTip(Button filter)

#region Event Handlers

protected override void OnShown(EventArgs e)
{
base.OnShown(e);
if (Settings != null && Settings.QuickOutlineSize.Width > MinimumSize.Width) Size = Settings.QuickOutlineSize;
}

protected override void OnKeyDown(KeyEventArgs e)
{
var keyCode = e.KeyCode;
Expand Down Expand Up @@ -259,7 +262,7 @@ protected override void OnKeyDown(KeyEventArgs e)
}
}

protected override void OnFormClosing(FormClosingEventArgs e) => settings.QuickOutlineSize = Size;
protected override void OnFormClosing(FormClosingEventArgs e) => Settings.QuickOutlineSize = Size;

void OnInputTextChanged(object sender, EventArgs e) => RefreshTree();

Expand Down

0 comments on commit f77a0cb

Please sign in to comment.