feature<PageTabBar>: apply repository configuration updates (bookmarks, titles, etc.)

This commit is contained in:
Jai 2021-08-13 18:28:07 +08:00
parent 1845fbbbc8
commit fbb59823bf
4 changed files with 120 additions and 17 deletions

View file

@ -14,12 +14,23 @@ namespace SourceGit.Views.Widgets {
/// <summary>
/// 标签数据
/// </summary>
public class Tab {
public class Tab : Controls.BindableBase {
public string Id { get; set; }
public bool IsWelcomePage { get; set; }
public string Title { get; set; }
private string title;
public string Title {
get => title;
set => SetProperty(ref title, value);
}
public string Tooltip { get; set; }
public int Bookmark { get; set; }
private int bookmark = 0;
public int Bookmark {
get => bookmark;
set => SetProperty(ref bookmark, value);
}
}
/// <summary>
@ -123,6 +134,16 @@ namespace SourceGit.Views.Widgets {
if (curTab.Id == id) container.SelectedItem = replaced;
}
public void Update(string id, int bookmark, string title) {
foreach (var one in Tabs) {
if (one.Id == id) {
one.Bookmark = bookmark;
one.Title = title;
break;
}
}
}
public bool Goto(string id) {
foreach (var tab in Tabs) {
if (tab.Id == id) {