code_style: run dotnet format

This commit is contained in:
leo 2024-06-06 15:31:02 +08:00
parent ed62174942
commit 4610f702b3
No known key found for this signature in database
GPG key ID: B528468E49CD0E58
29 changed files with 48 additions and 76 deletions

View file

@ -19,14 +19,5 @@ namespace SourceGit.Converters
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);
}
}

View file

@ -38,8 +38,8 @@ namespace SourceGit.Converters
});
public static readonly FuncValueConverter<Models.DecoratorType, FontWeight> ToFontWeight =
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
new FuncValueConverter<Models.DecoratorType, FontWeight>(v =>
v is Models.DecoratorType.CurrentBranchHead or Models.DecoratorType.CurrentCommitHead
? FontWeight.Bold : FontWeight.Regular
);
}

View file

@ -25,14 +25,7 @@ namespace SourceGit.Converters
var selected = array[1] as 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 false;
}
else
{
return true;
}
return selected != null && collections != null && (self == selected || collections.IndexOf(self) + 1 == collections.IndexOf(selected));
});
}
}

View file

@ -30,17 +30,11 @@ namespace SourceGit.Converters
{
var theme = (string)value;
if (theme.Equals("Light", StringComparison.OrdinalIgnoreCase))
{
return ThemeVariant.Light;
}
else if (theme.Equals("Dark", StringComparison.OrdinalIgnoreCase))
{
return ThemeVariant.Dark;
}
else
{
return ThemeVariant.Default;
}
}
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 =
new FuncValueConverter<string, string>(v => v == null ? string.Empty : (v.Length > 10 ? v.Substring(0, 10) : v));
public static readonly FuncValueConverter<string, bool> UnderRecommendGitVersion =
new(v =>
{

View file

@ -12,30 +12,20 @@ namespace SourceGit.Converters
new FuncValueConverter<WindowState, Thickness>(state =>
{
if (OperatingSystem.IsWindows() && state == WindowState.Maximized)
{
return new Thickness(6);
}
else if (OperatingSystem.IsLinux() && state != WindowState.Maximized)
{
return new Thickness(6);
}
else
{
return new Thickness(0);
}
});
public static readonly FuncValueConverter<WindowState, GridLength> ToTitleBarHeight =
new FuncValueConverter<WindowState, GridLength>(state =>
{
if (state == WindowState.Maximized)
{
return new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
}
else
{
return new GridLength(38);
}
});
public static readonly FuncValueConverter<WindowState, bool> IsNormal =