mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 18:30:34 +08:00
fix: repository settings did not saved correctly when closing app (#459)
This commit is contained in:
@@ -107,6 +107,21 @@ namespace SourceGit.ViewModels
|
||||
_ignoreIndexChange = false;
|
||||
}
|
||||
|
||||
public void Quit(double width, double height)
|
||||
{
|
||||
var pref = Preference.Instance;
|
||||
pref.Layout.LauncherWidth = width;
|
||||
pref.Layout.LauncherHeight = height;
|
||||
pref.Save();
|
||||
|
||||
_ignoreIndexChange = true;
|
||||
|
||||
foreach (var one in Pages)
|
||||
CloseRepositoryInTab(one, false);
|
||||
|
||||
_ignoreIndexChange = false;
|
||||
}
|
||||
|
||||
public void AddNewTab()
|
||||
{
|
||||
var page = new LauncherPage();
|
||||
|
||||
@@ -221,11 +221,7 @@ namespace SourceGit.Views
|
||||
|
||||
protected override void OnClosing(WindowClosingEventArgs e)
|
||||
{
|
||||
var pref = ViewModels.Preference.Instance;
|
||||
pref.Layout.LauncherWidth = Width;
|
||||
pref.Layout.LauncherHeight = Height;
|
||||
pref.Save();
|
||||
|
||||
(DataContext as ViewModels.Launcher)?.Quit(Width, Height);
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user