mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -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
|
@ -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,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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,18 +30,12 @@ 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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 =
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ 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.
|
||||||
|
|
Loading…
Reference in a new issue