mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
feature: workspace support (#445)
This commit is contained in:
parent
acd6171350
commit
ebc112a627
27 changed files with 473 additions and 109 deletions
|
@ -22,6 +22,7 @@
|
|||
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
<StyleInclude Source="avares://Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml" />
|
||||
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
|
||||
<StyleInclude Source="/Resources/Styles.axaml"/>
|
||||
</Application.Styles>
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Converters
|
||||
{
|
||||
public static class BookmarkConverters
|
||||
{
|
||||
public static readonly FuncValueConverter<int, IBrush> ToBrush =
|
||||
new FuncValueConverter<int, IBrush>(bookmark =>
|
||||
{
|
||||
if (bookmark == 0)
|
||||
return Application.Current?.FindResource("Brush.FG1") as IBrush;
|
||||
else
|
||||
return Models.Bookmarks.Brushes[bookmark];
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,5 +1,10 @@
|
|||
using Avalonia;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Converters
|
||||
{
|
||||
|
@ -28,5 +33,29 @@ namespace SourceGit.Converters
|
|||
|
||||
public static readonly FuncValueConverter<int, Thickness> ToTreeMargin =
|
||||
new FuncValueConverter<int, Thickness>(v => new Thickness(v * 16, 0, 0, 0));
|
||||
|
||||
public static readonly FuncValueConverter<int, IBrush> ToBookmarkBrush =
|
||||
new FuncValueConverter<int, IBrush>(bookmark =>
|
||||
{
|
||||
if (bookmark == 0)
|
||||
return Application.Current?.FindResource("Brush.FG1") as IBrush;
|
||||
else
|
||||
return Models.Bookmarks.Brushes[bookmark];
|
||||
});
|
||||
|
||||
public class ToColorConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return Color.FromUInt32((uint)value);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return ((Color)value).ToUInt32();
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly ToColorConverter ToColor = new ToColorConverter();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
<StreamGeometry x:Key="Icons.Window.Maximize">M153 154h768v768h-768v-768zm64 64v640h640v-640h-640z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Window.Restore">M256 128l0 192L64 320l0 576 704 0 0-192 192 0L960 128 256 128zM704 832 128 832 128 384l576 0L704 832zM896 640l-128 0L768 320 320 320 320 192l576 0L896 640z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.WordWrap">M248 221a77 77 0 00-30-21c-18-7-40-10-68-5a224 224 0 00-45 13c-5 2-10 5-15 8l-3 2v68l11-9c10-8 21-14 34-19 13-5 26-7 39-7 12 0 21 3 28 10 6 6 9 16 9 29l-62 9c-14 2-26 6-36 11a80 80 0 00-25 20c-7 8-12 17-15 27-6 21-6 44 1 65a70 70 0 0041 43c10 4 21 6 34 6a80 80 0 0063-28v22h64V298c0-16-2-31-6-44a91 91 0 00-18-33zm-41 121v15c0 8-1 15-4 22a48 48 0 01-24 29 44 44 0 01-33 2 29 29 0 01-10-6 25 25 0 01-6-9 30 30 0 01-2-12c0-5 1-9 2-14a21 21 0 015-9 28 28 0 0110-7 83 83 0 0120-5l42-6zm323-68a144 144 0 00-16-42 87 87 0 00-28-29 75 75 0 00-41-11 73 73 0 00-44 14c-6 5-12 11-17 17V64H326v398h59v-18c8 10 18 17 30 21 6 2 13 3 21 3 16 0 31-4 43-11 12-7 23-18 31-31a147 147 0 0019-46 248 248 0 006-57c0-17-2-33-5-49zm-55 49c0 15-1 28-4 39-2 11-6 20-10 27a41 41 0 01-15 15 37 37 0 01-36 1 44 44 0 01-13-12 59 59 0 01-9-18A76 76 0 01384 352v-33c0-10 1-20 4-29 2-8 6-15 10-22a43 43 0 0115-13 37 37 0 0119-5 35 35 0 0132 18c4 6 7 14 9 23 2 9 3 20 3 31zM154 634a58 58 0 0120-15c14-6 35-7 49-1 7 3 13 6 20 12l21 17V572l-6-4a124 124 0 00-58-14c-20 0-38 4-54 11-16 7-30 17-41 30-12 13-20 29-26 46-6 17-9 36-9 57 0 18 3 36 8 52 6 16 14 30 24 42 10 12 23 21 38 28 15 7 32 10 50 10 15 0 28-2 39-5 11-3 21-8 30-14l5-4v-57l-13 6a26 26 0 01-5 2c-3 1-6 2-8 3-2 1-15 6-15 6-4 2-9 3-14 4a63 63 0 01-38-4 53 53 0 01-20-14 70 70 0 01-13-24 111 111 0 01-5-34c0-13 2-26 5-36 3-10 8-19 14-26zM896 384h-256V320h288c21 1 32 12 32 32v384c0 18-12 32-32 32H504l132 133-45 45-185-185c-16-21-16-25 0-45l185-185L637 576l-128 128H896V384z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Workspace">M128 691H6V38h838v160h-64V102H70v525H128zM973 806H154V250h819v557zm-755-64h691V314H218v429zM365 877h448v64h-448z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Worktree">M512 0C229 0 0 72 0 160v128C0 376 229 448 512 448s512-72 512-160v-128C1024 72 795 0 512 0zM512 544C229 544 0 472 0 384v192c0 88 229 160 512 160s512-72 512-160V384c0 88-229 160-512 160zM512 832c-283 0-512-72-512-160v192C0 952 229 1024 512 1024s512-72 512-160v-192c0 88-229 160-512 160z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Worktree.Add">M640 725 768 725 768 597 853 597 853 725 981 725 981 811 853 811 853 939 768 939 768 811 640 811 640 725M384 128C573 128 725 204 725 299 725 393 573 469 384 469 195 469 43 393 43 299 43 204 195 128 384 128M43 384C43 478 195 555 384 555 573 555 725 478 725 384L725 512 683 512 683 595C663 612 640 627 610 640L555 640 555 660C504 675 446 683 384 683 195 683 43 606 43 512L43 384M43 597C43 692 195 768 384 768 446 768 504 760 555 745L555 873C504 888 446 896 384 896 195 896 43 820 43 725L43 597Z</StreamGeometry>
|
||||
</ResourceDictionary>
|
||||
|
|
|
@ -392,7 +392,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">Beim Starten nach Updates suchen</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">Sprache</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">Commit-Historie</x:String>
|
||||
<x:String x:Key="Text.Preference.General.RestoreTabs" xml:space="preserve">Zuletzt geöffnete Tabs beim Starten wiederherstellen</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">Längenvorgabe für Commit-Nachrichten</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">Remotes automatisch fetchen</x:String>
|
||||
|
|
|
@ -146,6 +146,9 @@
|
|||
<x:String x:Key="Text.Configure.Proxy.Placeholder" xml:space="preserve">HTTP proxy used by this repository</x:String>
|
||||
<x:String x:Key="Text.Configure.User" xml:space="preserve">User Name</x:String>
|
||||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">User name for this repository</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Workspaces</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">Name</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Color</x:String>
|
||||
<x:String x:Key="Text.Copy" xml:space="preserve">Copy</x:String>
|
||||
<x:String x:Key="Text.CopyAllText" xml:space="preserve">Copy All Text</x:String>
|
||||
<x:String x:Key="Text.CopyMessage" xml:space="preserve">COPY MESSAGE</x:String>
|
||||
|
@ -394,7 +397,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">Check for updates on startup</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">Language</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">History Commits</x:String>
|
||||
<x:String x:Key="Text.Preference.General.RestoreTabs" xml:space="preserve">Restore last opened tab(s) on startup</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">Subject Guide Length</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">Fetch remotes automatically</x:String>
|
||||
|
@ -624,6 +626,7 @@
|
|||
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">VIEW ASSUME UNCHANGED</x:String>
|
||||
<x:String x:Key="Text.WorkingCopy.UseCommitTemplate" xml:space="preserve">Template: ${0}$</x:String>
|
||||
<x:String x:Key="Text.WorkingCopy.ResolveTip" xml:space="preserve">Right-click the selected file(s), and make your choice to resolve conflicts.</x:String>
|
||||
<x:String x:Key="Text.Workspace.Configure" xml:space="preserve">Configure...</x:String>
|
||||
<x:String x:Key="Text.Worktree" xml:space="preserve">WORKTREE</x:String>
|
||||
<x:String x:Key="Text.Worktree.CopyPath" xml:space="preserve">Copy Path</x:String>
|
||||
<x:String x:Key="Text.Worktree.Lock" xml:space="preserve">Lock</x:String>
|
||||
|
|
|
@ -391,7 +391,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">Vérifier les mises à jour au démarrage</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">Language</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">Historique de commits</x:String>
|
||||
<x:String x:Key="Text.Preference.General.RestoreTabs" xml:space="preserve">Restaurer les onglets au démarrage</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">Guide de longueur du sujet</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">Fetch les dépôts distants automatiquement</x:String>
|
||||
|
|
|
@ -385,7 +385,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">Verificar atualizações na inicialização</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">Idioma</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">Commits do Histórico</x:String>
|
||||
<x:String x:Key="Text.Preference.General.RestoreTabs" xml:space="preserve">Restaurar as últimas abas abertas na inicialização</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">Comprimento do Guia de Assunto</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">Buscar remotos automaticamente</x:String>
|
||||
|
|
|
@ -149,6 +149,9 @@
|
|||
<x:String x:Key="Text.Configure.Proxy.Placeholder" xml:space="preserve">HTTP网络代理</x:String>
|
||||
<x:String x:Key="Text.Configure.User" xml:space="preserve">用户名</x:String>
|
||||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">应用于本仓库的用户名</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">工作区</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">名称</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">颜色</x:String>
|
||||
<x:String x:Key="Text.Copy" xml:space="preserve">复制</x:String>
|
||||
<x:String x:Key="Text.CopyAllText" xml:space="preserve">复制全部文本</x:String>
|
||||
<x:String x:Key="Text.CopyMessage" xml:space="preserve">复制内容</x:String>
|
||||
|
@ -397,7 +400,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">启动时检测软件更新</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">显示语言</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">最大历史提交数</x:String>
|
||||
<x:String x:Key="Text.Preference.General.RestoreTabs" xml:space="preserve">启动时恢复上次打开的仓库</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">SUBJECT字数检测</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT配置</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">启用定时自动拉取远程更新</x:String>
|
||||
|
@ -626,6 +628,7 @@
|
|||
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">查看忽略变更文件</x:String>
|
||||
<x:String x:Key="Text.WorkingCopy.UseCommitTemplate" xml:space="preserve">模板:${0}$</x:String>
|
||||
<x:String x:Key="Text.WorkingCopy.ResolveTip" xml:space="preserve">请选中冲突文件,打开右键菜单,选择合适的解决方式</x:String>
|
||||
<x:String x:Key="Text.Workspace.Configure" xml:space="preserve">配置工作区...</x:String>
|
||||
<x:String x:Key="Text.Worktree" xml:space="preserve">本地工作树</x:String>
|
||||
<x:String x:Key="Text.Worktree.CopyPath" xml:space="preserve">复制工作树路径</x:String>
|
||||
<x:String x:Key="Text.Worktree.Lock" xml:space="preserve">锁定工作树</x:String>
|
||||
|
|
|
@ -149,6 +149,9 @@
|
|||
<x:String x:Key="Text.Configure.Proxy.Placeholder" xml:space="preserve">HTTP 網路代理</x:String>
|
||||
<x:String x:Key="Text.Configure.User" xml:space="preserve">使用者名稱</x:String>
|
||||
<x:String x:Key="Text.Configure.User.Placeholder" xml:space="preserve">用於本存放庫的使用者名稱</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">工作區</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Name" xml:space="preserve">名稱</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">顏色</x:String>
|
||||
<x:String x:Key="Text.Copy" xml:space="preserve">複製</x:String>
|
||||
<x:String x:Key="Text.CopyAllText" xml:space="preserve">複製全部內容</x:String>
|
||||
<x:String x:Key="Text.CopyMessage" xml:space="preserve">複製內容</x:String>
|
||||
|
@ -397,7 +400,6 @@
|
|||
<x:String x:Key="Text.Preference.General.Check4UpdatesOnStartup" xml:space="preserve">啟動時檢查軟體更新</x:String>
|
||||
<x:String x:Key="Text.Preference.General.Locale" xml:space="preserve">顯示語言</x:String>
|
||||
<x:String x:Key="Text.Preference.General.MaxHistoryCommits" xml:space="preserve">最大歷史提交數</x:String>
|
||||
<x:String x:Key="Text.Preference.General.RestoreTabs" xml:space="preserve">啟動時還原上次開啟的存放庫</x:String>
|
||||
<x:String x:Key="Text.Preference.General.SubjectGuideLength" xml:space="preserve">提交標題字數偵測</x:String>
|
||||
<x:String x:Key="Text.Preference.Git" xml:space="preserve">Git 設定</x:String>
|
||||
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">啟用定時自動提取 (fetch) 遠端更新</x:String>
|
||||
|
@ -627,6 +629,7 @@
|
|||
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">檢視不追蹤變更的檔案</x:String>
|
||||
<x:String x:Key="Text.WorkingCopy.UseCommitTemplate" xml:space="preserve">範本: ${0}$</x:String>
|
||||
<x:String x:Key="Text.WorkingCopy.ResolveTip" xml:space="preserve">請選擇發生衝突的檔案,開啟右鍵選單,選擇合適的解決方式</x:String>
|
||||
<x:String x:Key="Text.Workspace.Configure" xml:space="preserve">配置工作區...</x:String>
|
||||
<x:String x:Key="Text.Worktree" xml:space="preserve">本機工作區</x:String>
|
||||
<x:String x:Key="Text.Worktree.CopyPath" xml:space="preserve">複製工作區路徑</x:String>
|
||||
<x:String x:Key="Text.Worktree.Lock" xml:space="preserve">鎖定工作區</x:String>
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.3" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" />
|
||||
|
|
60
src/ViewModels/ConfigureWorkspace.cs
Normal file
60
src/ViewModels/ConfigureWorkspace.cs
Normal file
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using Avalonia.Collections;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class ConfigureWorkspace : ObservableObject
|
||||
{
|
||||
public AvaloniaList<Workspace> Workspaces
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public Workspace Selected
|
||||
{
|
||||
get => _selected;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _selected, value))
|
||||
CanDeleteSelected = value != null && !value.IsActive;
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanDeleteSelected
|
||||
{
|
||||
get => _canDeleteSelected;
|
||||
private set => SetProperty(ref _canDeleteSelected, value);
|
||||
}
|
||||
|
||||
public ConfigureWorkspace()
|
||||
{
|
||||
Workspaces = new AvaloniaList<Workspace>();
|
||||
Workspaces.AddRange(Preference.Instance.Workspaces);
|
||||
}
|
||||
|
||||
public void Add()
|
||||
{
|
||||
var workspace = new Workspace();
|
||||
workspace.Name = $"Unnamed {DateTime.Now:yyyy-MM-dd HH:mm:ss}";
|
||||
workspace.Color = 4278221015;
|
||||
|
||||
Preference.Instance.Workspaces.Add(workspace);
|
||||
Workspaces.Add(workspace);
|
||||
Selected = workspace;
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
if (_selected == null || _selected.IsActive)
|
||||
return;
|
||||
|
||||
Preference.Instance.Workspaces.Remove(_selected);
|
||||
Workspaces.Remove(_selected);
|
||||
}
|
||||
|
||||
private Workspace _selected = null;
|
||||
private bool _canDeleteSelected = false;
|
||||
}
|
||||
}
|
|
@ -17,6 +17,12 @@ namespace SourceGit.ViewModels
|
|||
private set;
|
||||
}
|
||||
|
||||
public Workspace ActiveWorkspace
|
||||
{
|
||||
get => _activeWorkspace;
|
||||
private set => SetProperty(ref _activeWorkspace, value);
|
||||
}
|
||||
|
||||
public LauncherPage ActivePage
|
||||
{
|
||||
get => _activePage;
|
||||
|
@ -29,11 +35,35 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public Launcher(string startupRepo)
|
||||
{
|
||||
var pref = Preference.Instance;
|
||||
|
||||
Pages = new AvaloniaList<LauncherPage>();
|
||||
ActiveWorkspace = pref.GetActiveWorkspace();
|
||||
AddNewTab();
|
||||
|
||||
var pref = Preference.Instance;
|
||||
if (!string.IsNullOrEmpty(startupRepo))
|
||||
var repos = _activeWorkspace.Repositories.ToArray();
|
||||
foreach (var repo in repos)
|
||||
{
|
||||
var node = pref.FindNode(repo);
|
||||
if (node == null)
|
||||
{
|
||||
node = new RepositoryNode()
|
||||
{
|
||||
Id = repo,
|
||||
Name = Path.GetFileName(repo),
|
||||
Bookmark = 0,
|
||||
IsRepository = true,
|
||||
};
|
||||
}
|
||||
|
||||
OpenRepositoryInTab(node, null);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(startupRepo))
|
||||
{
|
||||
ActivePage = Pages[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
var test = new Commands.QueryRepositoryRootPath(startupRepo).ReadToEnd();
|
||||
if (!test.IsSuccess || string.IsNullOrEmpty(test.StdOut))
|
||||
|
@ -51,53 +81,6 @@ namespace SourceGit.ViewModels
|
|||
Welcome.Instance.Refresh();
|
||||
OpenRepositoryInTab(node, null);
|
||||
}
|
||||
else if (pref.RestoreTabs)
|
||||
{
|
||||
foreach (var id in pref.OpenedTabs)
|
||||
{
|
||||
var node = pref.FindNode(id);
|
||||
if (node == null)
|
||||
{
|
||||
node = new RepositoryNode()
|
||||
{
|
||||
Id = id,
|
||||
Name = Path.GetFileName(id),
|
||||
Bookmark = 0,
|
||||
IsRepository = true,
|
||||
};
|
||||
}
|
||||
|
||||
OpenRepositoryInTab(node, null);
|
||||
}
|
||||
|
||||
var lastActiveIdx = pref.LastActiveTabIdx;
|
||||
if (lastActiveIdx >= 0 && lastActiveIdx < Pages.Count)
|
||||
ActivePage = Pages[lastActiveIdx];
|
||||
}
|
||||
}
|
||||
|
||||
public void Quit()
|
||||
{
|
||||
var pref = Preference.Instance;
|
||||
pref.OpenedTabs.Clear();
|
||||
|
||||
if (pref.RestoreTabs)
|
||||
{
|
||||
foreach (var page in Pages)
|
||||
{
|
||||
if (page.Node.IsRepository)
|
||||
pref.OpenedTabs.Add(page.Node.Id);
|
||||
}
|
||||
}
|
||||
|
||||
pref.LastActiveTabIdx = Pages.IndexOf(ActivePage);
|
||||
pref.Save();
|
||||
|
||||
foreach (var page in Pages)
|
||||
{
|
||||
if (page.Data is Repository repo)
|
||||
repo.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddNewTab()
|
||||
|
@ -247,6 +230,7 @@ namespace SourceGit.ViewModels
|
|||
};
|
||||
|
||||
repo.Open();
|
||||
ActiveWorkspace.AddRepository(repo.FullPath);
|
||||
Models.AutoFetchManager.Instance.AddRepository(repo.FullPath);
|
||||
|
||||
if (page == null)
|
||||
|
@ -294,6 +278,46 @@ namespace SourceGit.ViewModels
|
|||
_activePage.Notifications.Add(notification);
|
||||
}
|
||||
|
||||
public ContextMenu CreateContextForWorkspace()
|
||||
{
|
||||
var pref = Preference.Instance;
|
||||
var menu = new ContextMenu();
|
||||
|
||||
for (var i = 0; i < pref.Workspaces.Count; i++)
|
||||
{
|
||||
var workspace = pref.Workspaces[i];
|
||||
|
||||
var icon = App.CreateMenuIcon(workspace.IsActive ? "Icons.Check" : "Icons.Workspace");
|
||||
icon.Fill = workspace.Brush;
|
||||
|
||||
var item = new MenuItem();
|
||||
item.Header = workspace.Name;
|
||||
item.Icon = icon;
|
||||
item.Click += (_, e) =>
|
||||
{
|
||||
if (!workspace.IsActive)
|
||||
SwitchWorkspace(workspace);
|
||||
|
||||
e.Handled = true;
|
||||
};
|
||||
|
||||
menu.Items.Add(item);
|
||||
}
|
||||
|
||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||
|
||||
var configure = new MenuItem();
|
||||
configure.Header = App.Text("Workspace.Configure");
|
||||
configure.Click += (_, e) =>
|
||||
{
|
||||
App.OpenDialog(new Views.ConfigureWorkspace() { DataContext = new ConfigureWorkspace() });
|
||||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(configure);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
public ContextMenu CreateContextForPageTab(LauncherPage page)
|
||||
{
|
||||
if (page == null)
|
||||
|
@ -369,10 +393,50 @@ namespace SourceGit.ViewModels
|
|||
return menu;
|
||||
}
|
||||
|
||||
private void CloseRepositoryInTab(LauncherPage page)
|
||||
private void SwitchWorkspace(Workspace to)
|
||||
{
|
||||
var pref = Preference.Instance;
|
||||
foreach (var w in pref.Workspaces)
|
||||
w.IsActive = false;
|
||||
|
||||
ActiveWorkspace = to;
|
||||
to.IsActive = true;
|
||||
|
||||
foreach (var one in Pages)
|
||||
CloseRepositoryInTab(one, false);
|
||||
|
||||
Pages.Clear();
|
||||
ActivePage = null;
|
||||
AddNewTab();
|
||||
|
||||
var repos = to.Repositories.ToArray();
|
||||
foreach (var repo in repos)
|
||||
{
|
||||
var node = pref.FindNode(repo);
|
||||
if (node == null)
|
||||
{
|
||||
node = new RepositoryNode()
|
||||
{
|
||||
Id = repo,
|
||||
Name = Path.GetFileName(repo),
|
||||
Bookmark = 0,
|
||||
IsRepository = true,
|
||||
};
|
||||
}
|
||||
|
||||
OpenRepositoryInTab(node, null);
|
||||
}
|
||||
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
private void CloseRepositoryInTab(LauncherPage page, bool removeFromWorkspace = true)
|
||||
{
|
||||
if (page.Data is Repository repo)
|
||||
{
|
||||
if (removeFromWorkspace)
|
||||
ActiveWorkspace.Repositories.Remove(repo.FullPath);
|
||||
|
||||
Models.AutoFetchManager.Instance.RemoveRepository(repo.FullPath);
|
||||
repo.Close();
|
||||
}
|
||||
|
@ -380,6 +444,7 @@ namespace SourceGit.ViewModels
|
|||
page.Data = null;
|
||||
}
|
||||
|
||||
private Workspace _activeWorkspace = null;
|
||||
private LauncherPage _activePage = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,9 @@ namespace SourceGit.ViewModels
|
|||
if (!_instance.IsGitConfigured())
|
||||
_instance.GitInstallPath = Native.OS.FindGitExecutable();
|
||||
|
||||
if (_instance.Workspaces.Count == 0)
|
||||
_instance.Workspaces.Add(new Workspace() { Name = "Default", Color = 4278221015 });
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
@ -133,12 +136,6 @@ namespace SourceGit.ViewModels
|
|||
set => SetProperty(ref _subjectGuideLength, value);
|
||||
}
|
||||
|
||||
public bool RestoreTabs
|
||||
{
|
||||
get => _restoreTabs;
|
||||
set => SetProperty(ref _restoreTabs, value);
|
||||
}
|
||||
|
||||
public bool UseFixedTabWidth
|
||||
{
|
||||
get => _useFixedTabWidth;
|
||||
|
@ -304,18 +301,12 @@ namespace SourceGit.ViewModels
|
|||
set;
|
||||
} = [];
|
||||
|
||||
public List<string> OpenedTabs
|
||||
public List<Workspace> Workspaces
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = [];
|
||||
|
||||
public int LastActiveTabIdx
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = 0;
|
||||
|
||||
public double LastCheckUpdateTime
|
||||
{
|
||||
get => _lastCheckUpdateTime;
|
||||
|
@ -343,6 +334,19 @@ namespace SourceGit.ViewModels
|
|||
return true;
|
||||
}
|
||||
|
||||
public Workspace GetActiveWorkspace()
|
||||
{
|
||||
foreach (var w in Workspaces)
|
||||
{
|
||||
if (w.IsActive)
|
||||
return w;
|
||||
}
|
||||
|
||||
var first = Workspaces[0];
|
||||
first.IsActive = true;
|
||||
return first;
|
||||
}
|
||||
|
||||
public void AddNode(RepositoryNode node, RepositoryNode to, bool save)
|
||||
{
|
||||
var collection = to == null ? RepositoryNodes : to.SubNodes;
|
||||
|
@ -492,7 +496,6 @@ namespace SourceGit.ViewModels
|
|||
|
||||
private int _maxHistoryCommits = 20000;
|
||||
private int _subjectGuideLength = 50;
|
||||
private bool _restoreTabs = false;
|
||||
private bool _useFixedTabWidth = true;
|
||||
|
||||
private bool _check4UpdatesOnStartup = true;
|
||||
|
|
58
src/ViewModels/Workspace.cs
Normal file
58
src/ViewModels/Workspace.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using Avalonia.Media;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class Workspace : ObservableObject
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value);
|
||||
}
|
||||
|
||||
public uint Color
|
||||
{
|
||||
get => _color;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _color, value))
|
||||
Brush = new SolidColorBrush(value);
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> Repositories
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new List<string>();
|
||||
|
||||
public bool IsActive
|
||||
{
|
||||
get => _isActive;
|
||||
set => SetProperty(ref _isActive, value);
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public IBrush Brush
|
||||
{
|
||||
get => _brush;
|
||||
private set => SetProperty(ref _brush, value);
|
||||
}
|
||||
|
||||
public void AddRepository(string repo)
|
||||
{
|
||||
if (!Repositories.Contains(repo))
|
||||
Repositories.Add(repo);
|
||||
}
|
||||
|
||||
private string _name = string.Empty;
|
||||
private uint _color = 0;
|
||||
private IBrush _brush = null;
|
||||
private bool _isActive = false;
|
||||
}
|
||||
}
|
122
src/Views/ConfigureWorkspace.axaml
Normal file
122
src/Views/ConfigureWorkspace.axaml
Normal file
|
@ -0,0 +1,122 @@
|
|||
<v:ChromelessWindow xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:m="using:SourceGit.Models"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
xmlns:v="using:SourceGit.Views"
|
||||
xmlns:c="using:SourceGit.Converters"
|
||||
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.ConfigureWorkspace"
|
||||
x:DataType="vm:ConfigureWorkspace"
|
||||
x:Name="ThisControl"
|
||||
Icon="/App.ico"
|
||||
Title="{DynamicResource Text.ConfigureWorkspace}"
|
||||
Width="600" SizeToContent="Height"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Grid RowDefinitions="Auto,Auto">
|
||||
<!-- TitleBar -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="{DynamicResource Brush.TitleBar}"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
||||
PointerPressed="BeginMoveWindow"/>
|
||||
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Data="{StaticResource Icons.Workspace}"
|
||||
Margin="10,0,0,0"
|
||||
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||
|
||||
<v:CaptionButtonsMacOS Grid.Column="0"
|
||||
Margin="0,2,0,0"
|
||||
IsCloseButtonOnly="True"
|
||||
IsVisible="{OnPlatform False, macOS=True}"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.ConfigureWorkspace}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsHitTestVisible="False"/>
|
||||
|
||||
<v:CaptionButtons Grid.Column="2"
|
||||
IsCloseButtonOnly="True"
|
||||
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- BODY -->
|
||||
<Grid Grid.Row="1" ColumnDefinitions="200,*" Height="250" Margin="8">
|
||||
<Border Grid.Column="0"
|
||||
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="{DynamicResource Brush.Contents}">
|
||||
<Grid RowDefinitions="*,1,Auto">
|
||||
<ListBox Grid.Row="0"
|
||||
Background="Transparent"
|
||||
ItemsSource="{Binding Workspaces}"
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="MinHeight" Value="0"/>
|
||||
<Setter Property="Height" Value="26"/>
|
||||
<Setter Property="Padding" Value="4,2"/>
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="vm:Workspace">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Path Grid.Column="0" Margin="4,0" Width="14" Height="14" Data="{StaticResource Icons.Workspace}" Fill="{Binding Brush}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" Margin="4,0" TextTrimming="CharacterEllipsis"/>
|
||||
<Path Grid.Column="2"
|
||||
Margin="4,0"
|
||||
Width="14" Height="14"
|
||||
Data="{StaticResource Icons.Check}"
|
||||
Fill="{DynamicResource Brush.FG1}"
|
||||
IsVisible="{Binding IsActive}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Rectangle Grid.Row="1" Height="1" Fill="{DynamicResource Brush.Border2}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"/>
|
||||
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Background="{DynamicResource Brush.ToolBar}">
|
||||
<Button Classes="icon_button" Command="{Binding Add}">
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Plus}"/>
|
||||
</Button>
|
||||
|
||||
<Rectangle Width="1" Fill="{DynamicResource Brush.Border2}" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
|
||||
|
||||
<Button Classes="icon_button" Command="{Binding Delete}" IsEnabled="{Binding CanDeleteSelected}">
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Window.Minimize}"/>
|
||||
</Button>
|
||||
|
||||
<Rectangle Width="1" Fill="{DynamicResource Brush.Border2}" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<ContentControl Grid.Column="1" Margin="16,0,0,0" Content="{Binding Selected}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="vm:Workspace">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto">
|
||||
<TextBlock Grid.Row="0" Text="{DynamicResource Text.ConfigureWorkspace.Name}"/>
|
||||
<TextBox Grid.Row="1" Margin="0,4,0,0" CornerRadius="3" Height="28" Text="{Binding Name, Mode=TwoWay}"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Margin="0,12,0,0" Text="{DynamicResource Text.ConfigureWorkspace.Color}"/>
|
||||
<ColorPicker Grid.Row="3" Margin="0,4,0,0" Width="100" HorizontalAlignment="Left" Color="{Binding Color, Converter={x:Static c:IntConverters.ToColor}, Mode=TwoWay}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</v:ChromelessWindow>
|
24
src/Views/ConfigureWorkspace.axaml.cs
Normal file
24
src/Views/ConfigureWorkspace.axaml.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class ConfigureWorkspace : ChromelessWindow
|
||||
{
|
||||
public ConfigureWorkspace()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnClosing(WindowClosingEventArgs e)
|
||||
{
|
||||
ViewModels.Preference.Instance.Save();
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
private void BeginMoveWindow(object _, PointerPressedEventArgs e)
|
||||
{
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
Text="{DynamicResource Text.DeleteRepositoryNode.Target}"/>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<Path Width="12" Height="12" Margin="0,0,8,0"
|
||||
Fill="{Binding Node.Bookmark, Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
Fill="{Binding Node.Bookmark, Converter={x:Static c:IntConverters.ToBookmarkBrush}}"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||
Data="{StaticResource Icons.Bookmark}"
|
||||
IsVisible="{Binding Node.IsRepository}"/>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<DataTemplate>
|
||||
<Border Height="20" VerticalAlignment="Center">
|
||||
<Path Width="12" Height="12"
|
||||
Fill="{Binding Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
Fill="{Binding Converter={x:Static c:IntConverters.ToBookmarkBrush}}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Data="{StaticResource Icons.Bookmark}"/>
|
||||
</Border>
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Custom TitleBar -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto">
|
||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,*,Auto">
|
||||
<!-- Bottom border -->
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="4"
|
||||
Background="{DynamicResource Brush.TitleBar}"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
||||
DoubleTapped="OnTitleBarDoubleTapped"
|
||||
|
@ -69,11 +69,18 @@
|
|||
<Path Width="12" Height="12" Data="{StaticResource Icons.Menu}"/>
|
||||
</Button>
|
||||
|
||||
<!-- Workspace Switcher -->
|
||||
<Button Grid.Column="1" Classes="icon_button" VerticalAlignment="Bottom" Click="OnOpenWorkspaceMenu" ToolTip.Tip="{Binding ActiveWorkspace.Name}">
|
||||
<Path Width="14" Height="14"
|
||||
Data="{StaticResource Icons.Workspace}"
|
||||
Fill="{Binding ActiveWorkspace.Brush}"/>
|
||||
</Button>
|
||||
|
||||
<!-- Pages Tabs-->
|
||||
<v:LauncherTabBar Grid.Column="1" Height="30" VerticalAlignment="Bottom"/>
|
||||
<v:LauncherTabBar Grid.Column="2" Height="30" VerticalAlignment="Bottom"/>
|
||||
|
||||
<!-- Caption Buttons (Windows/Linux)-->
|
||||
<Border Grid.Column="2" Margin="32,0,0,0" IsVisible="{Binding #ThisControl.IsRightCaptionButtonsVisible}">
|
||||
<Border Grid.Column="3" Margin="32,0,0,0" IsVisible="{Binding #ThisControl.IsRightCaptionButtonsVisible}">
|
||||
<v:CaptionButtons Height="30" VerticalAlignment="Top"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
|
|
@ -3,6 +3,7 @@ using System;
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
namespace SourceGit.Views
|
||||
|
@ -223,9 +224,7 @@ namespace SourceGit.Views
|
|||
var pref = ViewModels.Preference.Instance;
|
||||
pref.Layout.LauncherWidth = Width;
|
||||
pref.Layout.LauncherHeight = Height;
|
||||
|
||||
var vm = DataContext as ViewModels.Launcher;
|
||||
vm?.Quit();
|
||||
pref.Save();
|
||||
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
@ -248,6 +247,17 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenWorkspaceMenu(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button btn && DataContext is ViewModels.Launcher launcher)
|
||||
{
|
||||
var menu = launcher.CreateContextForWorkspace();
|
||||
btn.OpenContextMenu(menu);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private KeyModifiers _unhandledModifiers = KeyModifiers.None;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<Grid Width="{Binding Source={x:Static vm:Preference.Instance}, Path=UseFixedTabWidth, Converter={x:Static c:BoolConverters.ToPageTabWidth}}" Height="30" ColumnDefinitions="Auto,*,Auto" VerticalAlignment="Center">
|
||||
<Path Grid.Column="0"
|
||||
Width="12" Height="12" Margin="12,0"
|
||||
Fill="{Binding Node.Bookmark, Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
Fill="{Binding Node.Bookmark, Converter={x:Static c:IntConverters.ToBookmarkBrush}}"
|
||||
Data="{StaticResource Icons.Bookmark}"
|
||||
IsVisible="{Binding Node.IsRepository}"
|
||||
IsHitTestVisible="False"/>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<TabItem.Header>
|
||||
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.General}"/>
|
||||
</TabItem.Header>
|
||||
<Grid Margin="8" RowDefinitions="32,32,32,32,32" ColumnDefinitions="Auto,*">
|
||||
<Grid Margin="8" RowDefinitions="32,32,32,32" ColumnDefinitions="Auto,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="{DynamicResource Text.Preference.General.Locale}"
|
||||
HorizontalAlignment="Right"
|
||||
|
@ -98,10 +98,6 @@
|
|||
</Grid>
|
||||
|
||||
<CheckBox Grid.Row="3" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Preference.General.RestoreTabs}"
|
||||
IsChecked="{Binding RestoreTabs, Mode=TwoWay}"/>
|
||||
|
||||
<CheckBox Grid.Row="4" Grid.Column="1"
|
||||
Height="32"
|
||||
Content="{DynamicResource Text.Preference.General.Check4UpdatesOnStartup}"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=Check4UpdatesOnStartup, Mode=TwoWay}"/>
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="m:IssueTrackerRule">
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" Margin="8,0" TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock Text="{Binding Name}" Margin="8,0" TextTrimming="CharacterEllipsis"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
|
||||
<Path Grid.Column="1"
|
||||
Width="14" Height="14"
|
||||
Fill="{Binding Bookmark, Converter={x:Static c:BookmarkConverters.ToBrush}}"
|
||||
Fill="{Binding Bookmark, Converter={x:Static c:IntConverters.ToBookmarkBrush}}"
|
||||
HorizontalAlignment="Center"
|
||||
Data="{StaticResource Icons.Bookmark}"
|
||||
IsVisible="{Binding IsRepository}"/>
|
||||
|
|
Loading…
Reference in a new issue