style<Welcome>: re-design layout for Welcome page

This commit is contained in:
leo 2021-09-13 11:47:54 +08:00
parent 5712630235
commit 717772c62b
6 changed files with 1402 additions and 1443 deletions

View file

@ -208,6 +208,7 @@ namespace SourceGit.Models {
public WindowInfo Window { get; set; } = new WindowInfo();
public List<Group> Groups { get; set; } = new List<Group>();
public List<Repository> Repositories { get; set; } = new List<Repository>();
public List<string> Recents { get; set; } = new List<string>();
public RestoreTabs Restore { get; set; } = new RestoreTabs();
#endregion
@ -355,5 +356,36 @@ namespace SourceGit.Models {
if (removedIdx >= 0) Repositories.RemoveAt(removedIdx);
}
#endregion
#region RECENTS
public void AddRecent(string path) {
if (Recents.Count == 0) {
Recents.Add(path);
return;
}
for (int i = 0; i < Recents.Count; i++) {
if (Recents[i] == path) {
if (i != 0) {
Recents.RemoveAt(i);
Recents.Insert(0, path);
}
return;
}
}
Recents.Insert(0, path);
}
public void RemoveRecent(string path) {
for (int i = 0; i < Recents.Count; i++) {
if (Recents[i] == path) {
Recents.RemoveAt(i);
return;
}
}
}
#endregion
}
}