Browse Source

Fix #3414: Apply latest session settings before saving upon closing the main window

pull/3418/head
Siegfried Pammer 3 months ago
parent
commit
5fab18f3a0
  1. 3
      ILSpy/MainWindow.xaml.cs
  2. 6
      ILSpy/Search/SearchPaneModel.cs

3
ILSpy/MainWindow.xaml.cs

@ -102,6 +102,9 @@ namespace ICSharpCode.ILSpy
MessageBus.Send(this, new ApplySessionSettingsEventArgs(sessionSettings)); MessageBus.Send(this, new ApplySessionSettingsEventArgs(sessionSettings));
sessionSettings.WindowBounds = this.RestoreBounds; sessionSettings.WindowBounds = this.RestoreBounds;
// store window state in settings only if it's not minimized
if (this.WindowState != WindowState.Minimized)
sessionSettings.WindowState = this.WindowState;
sessionSettings.DockLayout.Serialize(new(DockManager)); sessionSettings.DockLayout.Serialize(new(DockManager));
snapshot.Save(); snapshot.Save();

6
ILSpy/Search/SearchPaneModel.cs

@ -54,6 +54,12 @@ namespace ICSharpCode.ILSpy.Search
SearchTerm = e.SearchTerm; SearchTerm = e.SearchTerm;
Show(); Show();
}; };
MessageBus<ApplySessionSettingsEventArgs>.Subscribers += ApplySessionSettings;
}
private void ApplySessionSettings(object sender, ApplySessionSettingsEventArgs e)
{
e.SessionSettings.SelectedSearchMode = SessionSettings.SelectedSearchMode;
} }
public SearchModeModel[] SearchModes { get; } = [ public SearchModeModel[] SearchModes { get; } = [

Loading…
Cancel
Save