mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: repository settings did not saved correctly when closing app (#459)
This commit is contained in:
parent
9b47198229
commit
2d611cf988
2 changed files with 16 additions and 5 deletions
|
@ -107,6 +107,21 @@ namespace SourceGit.ViewModels
|
||||||
_ignoreIndexChange = false;
|
_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()
|
public void AddNewTab()
|
||||||
{
|
{
|
||||||
var page = new LauncherPage();
|
var page = new LauncherPage();
|
||||||
|
|
|
@ -221,11 +221,7 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
protected override void OnClosing(WindowClosingEventArgs e)
|
protected override void OnClosing(WindowClosingEventArgs e)
|
||||||
{
|
{
|
||||||
var pref = ViewModels.Preference.Instance;
|
(DataContext as ViewModels.Launcher)?.Quit(Width, Height);
|
||||||
pref.Layout.LauncherWidth = Width;
|
|
||||||
pref.Layout.LauncherHeight = Height;
|
|
||||||
pref.Save();
|
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue