mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
feature: remember last active tab index if restore tabs is enabled
This commit is contained in:
parent
0e824f12b4
commit
3bf962d745
2 changed files with 11 additions and 0 deletions
|
@ -30,6 +30,11 @@ namespace SourceGit.ViewModels {
|
|||
|
||||
OpenRepositoryInTab(node, null);
|
||||
}
|
||||
|
||||
var lastActiveIdx = Preference.Instance.LastActiveTabIdx;
|
||||
if (lastActiveIdx >= 0 && lastActiveIdx < Pages.Count) {
|
||||
ActivePage = Pages[lastActiveIdx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,6 +47,7 @@ namespace SourceGit.ViewModels {
|
|||
}
|
||||
}
|
||||
|
||||
Preference.Instance.LastActiveTabIdx = Pages.IndexOf(ActivePage);
|
||||
Preference.Save();
|
||||
}
|
||||
|
||||
|
|
|
@ -178,6 +178,11 @@ namespace SourceGit.ViewModels {
|
|||
set;
|
||||
} = new List<string>();
|
||||
|
||||
public int LastActiveTabIdx {
|
||||
get;
|
||||
set;
|
||||
} = 0;
|
||||
|
||||
public static void AddNode(RepositoryNode node, RepositoryNode to = null) {
|
||||
var collection = to == null ? _instance._repositoryNodes : to.SubNodes;
|
||||
var list = new List<RepositoryNode>();
|
||||
|
|
Loading…
Reference in a new issue