mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
code_style: run dotnet format
This commit is contained in:
parent
ed62174942
commit
4610f702b3
29 changed files with 48 additions and 76 deletions
|
@ -163,14 +163,14 @@ namespace SourceGit
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var resDic = new ResourceDictionary();
|
var resDic = new ResourceDictionary();
|
||||||
|
|
||||||
var schema = JsonSerializer.Deserialize(File.ReadAllText(colorsFile), JsonCodeGen.Default.DictionaryStringString);
|
var schema = JsonSerializer.Deserialize(File.ReadAllText(colorsFile), JsonCodeGen.Default.DictionaryStringString);
|
||||||
foreach (var kv in schema)
|
foreach (var kv in schema)
|
||||||
resDic[kv.Key] = Color.Parse(kv.Value);
|
resDic[kv.Key] = Color.Parse(kv.Value);
|
||||||
|
|
||||||
app.Resources.MergedDictionaries.Add(resDic);
|
app.Resources.MergedDictionaries.Add(resDic);
|
||||||
app._colorOverrides = resDic;
|
app._colorOverrides = resDic;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,12 +52,12 @@ namespace SourceGit.Commands
|
||||||
var refName = parts[0];
|
var refName = parts[0];
|
||||||
if (refName.EndsWith("/HEAD", StringComparison.Ordinal))
|
if (refName.EndsWith("/HEAD", StringComparison.Ordinal))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (refName.StartsWith(PREFIX_DETACHED, StringComparison.Ordinal))
|
if (refName.StartsWith(PREFIX_DETACHED, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
branch.IsHead = true;
|
branch.IsHead = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (refName.StartsWith(PREFIX_LOCAL, StringComparison.Ordinal))
|
if (refName.StartsWith(PREFIX_LOCAL, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
branch.Name = refName.Substring(PREFIX_LOCAL.Length);
|
branch.Name = refName.Substring(PREFIX_LOCAL.Length);
|
||||||
|
|
|
@ -57,7 +57,8 @@ namespace SourceGit.Commands
|
||||||
if (line.Equals(_endOfBodyToken, StringComparison.Ordinal))
|
if (line.Equals(_endOfBodyToken, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
_nextPartIdx = 0;
|
_nextPartIdx = 0;
|
||||||
if (!string.IsNullOrEmpty(_current.Message)) _current.Message = _current.Message.Trim();
|
if (!string.IsNullOrEmpty(_current.Message))
|
||||||
|
_current.Message = _current.Message.Trim();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,8 @@ namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
public class QuerySingleCommit : Command
|
public class QuerySingleCommit : Command
|
||||||
{
|
{
|
||||||
public QuerySingleCommit(string repo, string sha) {
|
public QuerySingleCommit(string repo, string sha)
|
||||||
|
{
|
||||||
WorkingDirectory = repo;
|
WorkingDirectory = repo;
|
||||||
Context = repo;
|
Context = repo;
|
||||||
Args = $"show --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B -s {sha}";
|
Args = $"show --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B -s {sha}";
|
||||||
|
@ -19,7 +20,7 @@ namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
var commit = new Models.Commit();
|
var commit = new Models.Commit();
|
||||||
var lines = rs.StdOut.Split('\n');
|
var lines = rs.StdOut.Split('\n');
|
||||||
if (lines.Length < 8)
|
if (lines.Length < 8)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
commit.SHA = lines[0];
|
commit.SHA = lines[0];
|
||||||
|
|
|
@ -19,14 +19,5 @@ namespace SourceGit.Converters
|
||||||
return App.Current?.FindResource("Icons.Tree") as StreamGeometry;
|
return App.Current?.FindResource("Icons.Tree") as StreamGeometry;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly FuncValueConverter<Models.ChangeViewMode, bool> IsList =
|
|
||||||
new FuncValueConverter<Models.ChangeViewMode, bool>(v => v == Models.ChangeViewMode.List);
|
|
||||||
|
|
||||||
public static readonly FuncValueConverter<Models.ChangeViewMode, bool> IsGrid =
|
|
||||||
new FuncValueConverter<Models.ChangeViewMode, bool>(v => v == Models.ChangeViewMode.Grid);
|
|
||||||
|
|
||||||
public static readonly FuncValueConverter<Models.ChangeViewMode, bool> IsTree =
|
|
||||||
new FuncValueConverter<Models.ChangeViewMode, bool>(v => v == Models.ChangeViewMode.Tree);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,8 +38,8 @@ namespace SourceGit.Converters
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
|
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
|
||||||
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
|
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
|
||||||
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
|
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
|
||||||
? FontWeight.Bold : FontWeight.Regular
|
? FontWeight.Bold : FontWeight.Regular
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,14 +25,7 @@ namespace SourceGit.Converters
|
||||||
var selected = array[1] as ViewModels.LauncherPage;
|
var selected = array[1] as ViewModels.LauncherPage;
|
||||||
var collections = array[2] as AvaloniaList<ViewModels.LauncherPage>;
|
var collections = array[2] as AvaloniaList<ViewModels.LauncherPage>;
|
||||||
|
|
||||||
if (selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected)))
|
return selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected));
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,17 +30,11 @@ namespace SourceGit.Converters
|
||||||
{
|
{
|
||||||
var theme = (string)value;
|
var theme = (string)value;
|
||||||
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
|
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
|
||||||
return ThemeVariant.Light;
|
return ThemeVariant.Light;
|
||||||
}
|
|
||||||
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
|
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
|
||||||
return ThemeVariant.Dark;
|
return ThemeVariant.Dark;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return ThemeVariant.Default;
|
return ThemeVariant.Default;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
@ -70,7 +64,7 @@ namespace SourceGit.Converters
|
||||||
|
|
||||||
public static readonly FuncValueConverter<string, string> ToShortSHA =
|
public static readonly FuncValueConverter<string, string> ToShortSHA =
|
||||||
new FuncValueConverter<string, string>(v => v == null ? string.Empty : (v.Length > 10 ? v.Substring(0, 10) : v));
|
new FuncValueConverter<string, string>(v => v == null ? string.Empty : (v.Length > 10 ? v.Substring(0, 10) : v));
|
||||||
|
|
||||||
public static readonly FuncValueConverter<string, bool> UnderRecommendGitVersion =
|
public static readonly FuncValueConverter<string, bool> UnderRecommendGitVersion =
|
||||||
new(v =>
|
new(v =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,30 +12,20 @@ namespace SourceGit.Converters
|
||||||
new FuncValueConverter<WindowState, Thickness>(state =>
|
new FuncValueConverter<WindowState, Thickness>(state =>
|
||||||
{
|
{
|
||||||
if (OperatingSystem.IsWindows() && state == WindowState.Maximized)
|
if (OperatingSystem.IsWindows() && state == WindowState.Maximized)
|
||||||
{
|
|
||||||
return new Thickness(6);
|
return new Thickness(6);
|
||||||
}
|
|
||||||
else if (OperatingSystem.IsLinux() && state != WindowState.Maximized)
|
else if (OperatingSystem.IsLinux() && state != WindowState.Maximized)
|
||||||
{
|
|
||||||
return new Thickness(6);
|
return new Thickness(6);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return new Thickness(0);
|
return new Thickness(0);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly FuncValueConverter<WindowState, GridLength> ToTitleBarHeight =
|
public static readonly FuncValueConverter<WindowState, GridLength> ToTitleBarHeight =
|
||||||
new FuncValueConverter<WindowState, GridLength>(state =>
|
new FuncValueConverter<WindowState, GridLength>(state =>
|
||||||
{
|
{
|
||||||
if (state == WindowState.Maximized)
|
if (state == WindowState.Maximized)
|
||||||
{
|
|
||||||
return new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
|
return new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
return new GridLength(38);
|
return new GridLength(38);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
public static readonly FuncValueConverter<WindowState, bool> IsNormal =
|
public static readonly FuncValueConverter<WindowState, bool> IsNormal =
|
||||||
|
|
|
@ -182,7 +182,7 @@ namespace SourceGit.Models
|
||||||
{
|
{
|
||||||
var focus = _source.Rows[row.RowIndex];
|
var focus = _source.Rows[row.RowIndex];
|
||||||
if (focus is IExpander expander && HasChildren(focus))
|
if (focus is IExpander expander && HasChildren(focus))
|
||||||
expander.IsExpanded = !expander.IsExpanded;
|
expander.IsExpanded = !expander.IsExpanded;
|
||||||
else
|
else
|
||||||
_rowDoubleTapped?.Invoke(this, e);
|
_rowDoubleTapped?.Invoke(this, e);
|
||||||
|
|
||||||
|
@ -455,7 +455,7 @@ namespace SourceGit.Models
|
||||||
foreach (var c in children)
|
foreach (var c in children)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
get => Type == BranchTreeNodeType.Branch;
|
get => Type == BranchTreeNodeType.Branch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsDetachedHead
|
public bool IsDetachedHead
|
||||||
{
|
{
|
||||||
get => Type == BranchTreeNodeType.DetachedHead;
|
get => Type == BranchTreeNodeType.DetachedHead;
|
||||||
|
@ -219,7 +219,7 @@ namespace SourceGit.ViewModels
|
||||||
start = sepIdx + 1;
|
start = sepIdx + 1;
|
||||||
sepIdx = branch.Name.IndexOf('/', start);
|
sepIdx = branch.Name.IndexOf('/', start);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastFolder.Children.Add(new BranchTreeNode()
|
lastFolder.Children.Add(new BranchTreeNode()
|
||||||
{
|
{
|
||||||
Name = Path.GetFileName(branch.Name),
|
Name = Path.GetFileName(branch.Name),
|
||||||
|
@ -242,7 +242,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
return l.Name.CompareTo(r.Name);
|
return l.Name.CompareTo(r.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)l.Type - (int)r.Type;
|
return (int)l.Type - (int)r.Type;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
namespace SourceGit.ViewModels
|
namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
public class CheckoutCommit: Popup
|
public class CheckoutCommit : Popup
|
||||||
{
|
{
|
||||||
public Models.Commit Commit
|
public Models.Commit Commit
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasLocalChanges
|
public bool HasLocalChanges
|
||||||
{
|
{
|
||||||
get => _repo.WorkingCopyChangesCount > 0;
|
get => _repo.WorkingCopyChangesCount > 0;
|
||||||
|
@ -32,7 +32,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
_repo.SetWatcherEnabled(false);
|
_repo.SetWatcherEnabled(false);
|
||||||
ProgressDescription = $"Checkout Commit '{Commit.SHA}' ...";
|
ProgressDescription = $"Checkout Commit '{Commit.SHA}' ...";
|
||||||
|
|
||||||
return Task.Run(() =>
|
return Task.Run(() =>
|
||||||
{
|
{
|
||||||
var needPopStash = false;
|
var needPopStash = false;
|
||||||
|
|
|
@ -228,7 +228,7 @@ namespace SourceGit.ViewModels
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
menu.Items.Add(copyFileName);
|
menu.Items.Add(copyFileName);
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace SourceGit.ViewModels
|
namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
public class CreateBranch : Popup
|
public class CreateBranch : Popup
|
||||||
{
|
{
|
||||||
[Required(ErrorMessage = "Branch name is required!")]
|
[Required(ErrorMessage = "Branch name is required!")]
|
||||||
|
@ -19,13 +19,13 @@ namespace SourceGit.ViewModels
|
||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Models.DealWithLocalChanges PreAction
|
public Models.DealWithLocalChanges PreAction
|
||||||
{
|
{
|
||||||
get => _preAction;
|
get => _preAction;
|
||||||
set => SetProperty(ref _preAction, value);
|
set => SetProperty(ref _preAction, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckoutAfterCreated
|
public bool CheckoutAfterCreated
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
SetProgressDescription("Deleting tracking remote branch...");
|
SetProgressDescription("Deleting tracking remote branch...");
|
||||||
Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name);
|
Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace SourceGit.ViewModels
|
||||||
Targets = branches;
|
Targets = branches;
|
||||||
View = new Views.DeleteMultipleBranches() { DataContext = this };
|
View = new Views.DeleteMultipleBranches() { DataContext = this };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<bool> Sure()
|
public override Task<bool> Sure()
|
||||||
{
|
{
|
||||||
_repo.SetWatcherEnabled(false);
|
_repo.SetWatcherEnabled(false);
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace SourceGit.ViewModels
|
||||||
if (latest.TextDiff != null)
|
if (latest.TextDiff != null)
|
||||||
{
|
{
|
||||||
var repo = Preference.FindRepository(_repo);
|
var repo = Preference.FindRepository(_repo);
|
||||||
if (repo != null && repo.Submodules.Contains(_option.Path))
|
if (repo != null && repo.Submodules.Contains(_option.Path))
|
||||||
{
|
{
|
||||||
var submoduleDiff = new Models.SubmoduleDiff();
|
var submoduleDiff = new Models.SubmoduleDiff();
|
||||||
var submoduleRoot = $"{_repo}/{_option.Path}".Replace("\\", "/");
|
var submoduleRoot = $"{_repo}/{_option.Path}".Replace("\\", "/");
|
||||||
|
@ -164,7 +164,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
var fullPath = Path.Combine(_repo, _option.Path);
|
var fullPath = Path.Combine(_repo, _option.Path);
|
||||||
(imgDiff.Old, imgDiff.OldFileSize) = BitmapFromRevisionFile(_repo, "HEAD", oldPath);
|
(imgDiff.Old, imgDiff.OldFileSize) = BitmapFromRevisionFile(_repo, "HEAD", oldPath);
|
||||||
|
|
||||||
if (File.Exists(fullPath))
|
if (File.Exists(fullPath))
|
||||||
{
|
{
|
||||||
imgDiff.New = new Bitmap(fullPath);
|
imgDiff.New = new Bitmap(fullPath);
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace SourceGit.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
needPopStash = true;
|
needPopStash = true;
|
||||||
}
|
}
|
||||||
else if (_preAction == Models.DealWithLocalChanges.Discard)
|
else if (_preAction == Models.DealWithLocalChanges.Discard)
|
||||||
{
|
{
|
||||||
SetProgressDescription("Discard local changes ...");
|
SetProgressDescription("Discard local changes ...");
|
||||||
|
|
|
@ -192,7 +192,7 @@ namespace SourceGit.ViewModels
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
menu.Items.Add(copyFileName);
|
menu.Items.Add(copyFileName);
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
|
@ -793,7 +792,7 @@ namespace SourceGit.ViewModels
|
||||||
App.CopyText(change.Path);
|
App.CopyText(change.Path);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
var copyFileName = new MenuItem();
|
var copyFileName = new MenuItem();
|
||||||
copyFileName.Header = App.Text("CopyFileName");
|
copyFileName.Header = App.Text("CopyFileName");
|
||||||
copyFileName.Icon = App.CreateMenuIcon("Icons.Copy");
|
copyFileName.Icon = App.CreateMenuIcon("Icons.Copy");
|
||||||
|
|
|
@ -21,7 +21,8 @@ namespace SourceGit.Views
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnRemoveButtonClicked(object sender, RoutedEventArgs e) {
|
private void OnRemoveButtonClicked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
if (DataContext is ViewModels.AssumeUnchangedManager vm && sender is Button button)
|
if (DataContext is ViewModels.AssumeUnchangedManager vm && sender is Button button)
|
||||||
vm.Remove(button.DataContext as string);
|
vm.Remove(button.DataContext as string);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (Content is TreeDataGrid tree && tree.Source is IDisposable disposable)
|
if (Content is TreeDataGrid tree && tree.Source is IDisposable disposable)
|
||||||
disposable.Dispose();
|
disposable.Dispose();
|
||||||
|
|
||||||
Content = null;
|
Content = null;
|
||||||
|
|
||||||
var changes = Changes;
|
var changes = Changes;
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace SourceGit.Views
|
||||||
var toplevel = TopLevel.GetTopLevel(this);
|
var toplevel = TopLevel.GetTopLevel(this);
|
||||||
if (toplevel == null)
|
if (toplevel == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var selected = await toplevel.StorageProvider.OpenFolderPickerAsync(options);
|
var selected = await toplevel.StorageProvider.OpenFolderPickerAsync(options);
|
||||||
if (selected.Count == 1)
|
if (selected.Count == 1)
|
||||||
TxtParentFolder.Text = selected[0].Path.LocalPath;
|
TxtParentFolder.Text = selected[0].Path.LocalPath;
|
||||||
|
@ -31,7 +31,7 @@ namespace SourceGit.Views
|
||||||
var toplevel = TopLevel.GetTopLevel(this);
|
var toplevel = TopLevel.GetTopLevel(this);
|
||||||
if (toplevel == null)
|
if (toplevel == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var selected = await toplevel.StorageProvider.OpenFilePickerAsync(options);
|
var selected = await toplevel.StorageProvider.OpenFilePickerAsync(options);
|
||||||
if (selected.Count == 1)
|
if (selected.Count == 1)
|
||||||
TxtSshKey.Text = selected[0].Path.LocalPath;
|
TxtSshKey.Text = selected[0].Path.LocalPath;
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
if (DataContext is ViewModels.CommitDetail detail && CanNavigate)
|
if (DataContext is ViewModels.CommitDetail detail && CanNavigate)
|
||||||
detail.NavigateTo((sender as Control).DataContext as string);
|
detail.NavigateTo((sender as Control).DataContext as string);
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
var datagrid = sender as DataGrid;
|
var datagrid = sender as DataGrid;
|
||||||
detail.ActivePageIndex = 1;
|
detail.ActivePageIndex = 1;
|
||||||
detail.SelectedChanges = new () { datagrid.SelectedItem as Models.Change };
|
detail.SelectedChanges = new() { datagrid.SelectedItem as Models.Change };
|
||||||
}
|
}
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
|
|
@ -8,8 +8,9 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
public static void OpenContextMenu(this Control control, ContextMenu menu)
|
public static void OpenContextMenu(this Control control, ContextMenu menu)
|
||||||
{
|
{
|
||||||
if (menu == null) return;
|
if (menu == null)
|
||||||
|
return;
|
||||||
|
|
||||||
menu.PlacementTarget = control;
|
menu.PlacementTarget = control;
|
||||||
menu.Closing += OnContextMenuClosing; // Clear context menu because it is dynamic.
|
menu.Closing += OnContextMenuClosing; // Clear context menu because it is dynamic.
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
base.OnLoaded(e);
|
base.OnLoaded(e);
|
||||||
|
|
||||||
if (IsVisible)
|
if (IsVisible)
|
||||||
StartAnim();
|
StartAnim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace SourceGit.Views
|
||||||
if (IsVisible)
|
if (IsVisible)
|
||||||
StartAnim();
|
StartAnim();
|
||||||
else
|
else
|
||||||
StopAnim();
|
StopAnim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace SourceGit.Views
|
||||||
ViewModels.BranchTreeNode prev = null;
|
ViewModels.BranchTreeNode prev = null;
|
||||||
foreach (var node in repo.LocalBranchTrees)
|
foreach (var node in repo.LocalBranchTrees)
|
||||||
node.UpdateCornerRadius(ref prev);
|
node.UpdateCornerRadius(ref prev);
|
||||||
|
|
||||||
if (tree.SelectedItems.Count == 1)
|
if (tree.SelectedItems.Count == 1)
|
||||||
{
|
{
|
||||||
var node = tree.SelectedItem as ViewModels.BranchTreeNode;
|
var node = tree.SelectedItem as ViewModels.BranchTreeNode;
|
||||||
|
@ -303,12 +303,12 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CollectBranchesFromNode(List<Models.Branch> outs, ViewModels.BranchTreeNode node)
|
private void CollectBranchesFromNode(List<Models.Branch> outs, ViewModels.BranchTreeNode node)
|
||||||
{
|
{
|
||||||
if (node == null || node.IsRemote)
|
if (node == null || node.IsRemote)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (node.IsFolder)
|
if (node.IsFolder)
|
||||||
{
|
{
|
||||||
foreach (var child in node.Children)
|
foreach (var child in node.Children)
|
||||||
|
|
Loading…
Reference in a new issue