Icons, Style refactor
This commit is contained in:
@@ -6,5 +6,6 @@ namespace FileTime.App.Core.ViewModels;
|
||||
|
||||
public interface IElementViewModel : IItemViewModel, IInitable<IElement, ITabViewModel, ItemViewModelType>
|
||||
{
|
||||
IElement? Element { get; }
|
||||
long? Size { get; set; }
|
||||
}
|
||||
@@ -8,6 +8,8 @@ namespace FileTime.App.Core.ViewModels;
|
||||
[ViewModel(GenerateConstructor = false)]
|
||||
public partial class ElementViewModel : ItemViewModel, IElementViewModel
|
||||
{
|
||||
public IElement? Element => BaseItem as Element;
|
||||
|
||||
[Property]
|
||||
private long? _size;
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace FileTime.Core.Models;
|
||||
|
||||
public interface ISymlinkElement
|
||||
{
|
||||
IItem RealItem { get; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using FileTime.Core.Models;
|
||||
using FileTime.GuiApp.Models;
|
||||
|
||||
namespace FileTime.GuiApp.IconProviders;
|
||||
|
||||
public interface IIconProvider
|
||||
{
|
||||
ImagePath GetImage(IItem item);
|
||||
bool EnableAdvancedIcons { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace FileTime.GuiApp.Models;
|
||||
|
||||
public class ImagePath
|
||||
{
|
||||
public string? Path { get; }
|
||||
public ImagePathType Type { get; }
|
||||
public object? Image { get; }
|
||||
|
||||
public ImagePath(ImagePathType type, string path)
|
||||
{
|
||||
Path = path;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public ImagePath(ImagePathType type, object image)
|
||||
{
|
||||
Image = image;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace FileTime.GuiApp.Models;
|
||||
|
||||
public enum ImagePathType
|
||||
{
|
||||
Asset,
|
||||
Absolute,
|
||||
Raw
|
||||
}
|
||||
@@ -6,189 +6,15 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<Color x:Key="AppBackgroundColor">#E7073642</Color>
|
||||
<Color x:Key="ContainerBackgroundColor">#083e4c</Color>
|
||||
<Color x:Key="TransparentContainerBackgroundColor">#D0083e4c</Color>
|
||||
<Color x:Key="BarelyTransparentBackgroundColor">#80083e4c</Color>
|
||||
|
||||
<Color x:Key="ItemBackgroundColor">#00000000</Color>
|
||||
<Color x:Key="AlternativeItemBackgroundColor">#10000000</Color>
|
||||
<Color x:Key="SelectedItemBackgroundColor">#93a1a1</Color>
|
||||
<Color x:Key="MarkedItemBackgroundColor">#00000000</Color>
|
||||
<Color x:Key="MarkedAlternativeItemBackgroundColor">#10000000</Color>
|
||||
<Color x:Key="MarkedSelectedItemBackgroundColor">#b58900</Color>
|
||||
|
||||
<Color x:Key="ForegroundColor">#93a1a1</Color>
|
||||
<Color x:Key="AccentColor">#268bd2</Color>
|
||||
<Color x:Key="AccentComplementColor">#fdf6e3</Color>
|
||||
<Color x:Key="LightForegroundColor">#7793a1a1</Color>
|
||||
<Color x:Key="AlternativeItemForegroundColor">#93a1a1</Color>
|
||||
<Color x:Key="SelectedItemForegroundColor">#073642</Color>
|
||||
<Color x:Key="MarkedItemForegroundColor">#b58900</Color>
|
||||
<Color x:Key="MarkedAlternativeItemForegroundColor">#b58900</Color>
|
||||
<Color x:Key="MarkedSelectedItemForegroundColor">#002b36</Color>
|
||||
|
||||
<Color x:Key="ErrorColor">#dc322f</Color>
|
||||
|
||||
<LinearGradientBrush x:Key="ContentSeparatorBrush">
|
||||
<GradientStop Color="#0093a1a1" Offset="0" />
|
||||
<GradientStop Color="#93a1a1" Offset="0.5" />
|
||||
<GradientStop Color="#0093a1a1" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="ContainerGradientBackgroundBrush">
|
||||
<GradientStop Color="#00b58900" Offset="0" />
|
||||
<GradientStop Color="#CCb58900" Offset="0.4" />
|
||||
<GradientStop Color="#CCb58900" Offset="0.6" />
|
||||
<GradientStop Color="#00b58900" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource AppBackgroundColor}" x:Key="AppBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource ContainerBackgroundColor}" x:Key="ContainerBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource TransparentContainerBackgroundColor}"
|
||||
x:Key="TransparentContainerBackgroundBrush" />
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource ItemBackgroundColor}" x:Key="ItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AlternativeItemBackgroundColor}"
|
||||
x:Key="AlternativeItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemBackgroundColor}" x:Key="SelectedItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedItemBackgroundColor}" x:Key="MarkedItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedSelectedItemBackgroundColor}"
|
||||
x:Key="MarkedSelectedItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedAlternativeItemBackgroundColor}"
|
||||
x:Key="MarkedAlternativeItemBackgroundBrush" />
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource ForegroundColor}" x:Key="ForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AccentColor}" x:Key="AccentBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AccentComplementColor}" x:Key="AccentComplementBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource LightForegroundColor}" x:Key="LightForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AlternativeItemForegroundColor}"
|
||||
x:Key="AlternativeItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemForegroundColor}" x:Key="SelectedItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedItemForegroundColor}" x:Key="MarkedItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedAlternativeItemForegroundColor}"
|
||||
x:Key="MarkedAlternativeItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedSelectedItemForegroundColor}"
|
||||
x:Key="MarkedSelectedItemForegroundBrush" />
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource ErrorColor}" x:Key="ErrorBrush" />
|
||||
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemBackgroundColor}"
|
||||
x:Key="SystemControlHighlightListAccentLowBrush" />
|
||||
|
||||
|
||||
<converters:ItemViewModeToBrushConverter
|
||||
AlternativeBrush="{StaticResource AlternativeItemForegroundBrush}"
|
||||
DefaultBrush="{StaticResource ForegroundBrush}"
|
||||
MarkedAlternativeBrush="{StaticResource MarkedAlternativeItemForegroundBrush}"
|
||||
MarkedBrush="{StaticResource MarkedItemForegroundBrush}"
|
||||
MarkedSelectedBrush="{StaticResource MarkedSelectedItemForegroundBrush}"
|
||||
SelectedBrush="{StaticResource SelectedItemForegroundBrush}"
|
||||
x:Key="ItemViewModeToForegroundConverter" />
|
||||
<converters:ItemViewModeToBrushConverter
|
||||
AlternativeBrush="{StaticResource AlternativeItemBackgroundBrush}"
|
||||
DefaultBrush="{StaticResource ItemBackgroundBrush}"
|
||||
MarkedAlternativeBrush="{StaticResource MarkedAlternativeItemBackgroundBrush}"
|
||||
MarkedBrush="{StaticResource MarkedItemBackgroundBrush}"
|
||||
MarkedSelectedBrush="{StaticResource MarkedSelectedItemBackgroundBrush}"
|
||||
SelectedBrush="{StaticResource SelectedItemBackgroundBrush}"
|
||||
x:Key="ItemViewModeToBackgroundConverter" />
|
||||
<converters:NamePartShrinkerConverter x:Key="NamePartShrinkerConverter" />
|
||||
<converters:ItemViewModelIsAttributeTypeConverter x:Key="ItemViewModelIsAttributeTypeConverter" />
|
||||
<converters:ItemViewModelIsAttributeTypeConverter Invert="true"
|
||||
x:Key="ItemViewModelIsNotAttributeTypeConverter" />
|
||||
<converters:GetFileExtensionConverter x:Key="GetFileExtensionConverter" />
|
||||
<converters:FormatSizeConverter x:Key="FormatSizeConverter" />
|
||||
<converters:DateTimeConverter x:Key="DateTimeConverter" />
|
||||
<converters:SplitStringConverter x:Key="SplitStringConverter" />
|
||||
<converters:CompareConverter x:Key="EqualityConverter" />
|
||||
<converters:CompareConverter ComparisonCondition="{x:Static converters:ComparisonCondition.NotEqual}"
|
||||
x:Key="NotEqualsConverter" />
|
||||
<converters:ExceptionToStringConverter x:Key="ExceptionToStringConverter" />
|
||||
<converters:CommandToCommandNameConverter x:Key="CommandToCommandNameConverter" />
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="avares://FileTime.GuiApp/Resources/SolarizedDarkTheme.axaml"></ResourceInclude>
|
||||
<ResourceInclude Source="avares://FileTime.GuiApp/Resources/Brushes.axaml"></ResourceInclude>
|
||||
<ResourceInclude Source="avares://FileTime.GuiApp/Resources/Converters.axaml"></ResourceInclude>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
<Application.Styles>
|
||||
<FluentTheme Mode="Dark" />
|
||||
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.SmallText">
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.ExtraSmallText">
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ContainerBackgroundBrush}" />
|
||||
</Style>
|
||||
<Style Selector="ListBox.ContentListView">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="ListBox.ContentListView > ListBoxItem">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<!--Setter Property="ContextMenu">
|
||||
<ContextMenu Items="{Binding Converter={StaticResource ContextMenuGenerator}}"/>
|
||||
</Setter-->
|
||||
</Style>
|
||||
|
||||
<Style Selector="Grid.SidebarContainerPresenter">
|
||||
<Setter Property="Background" Value="#01000000" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Grid.SidebarContainerPresenter:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBackgroundColor}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Border.SelectedTimelineCommand">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ForegroundBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="ListBox.RadioButtonListBox">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="ListBox.RadioButtonListBox ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border>
|
||||
<RadioButton
|
||||
Content="{TemplateBinding ContentPresenter.Content}"
|
||||
Foreground="{DynamicResource ForegroundBrush}"
|
||||
IsChecked="{Binding Path=IsSelected, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
VerticalAlignment="Center" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Image.LoadingAnimation">
|
||||
<Style.Animations>
|
||||
<Animation
|
||||
Duration="0:0:2"
|
||||
Easing="QuadraticEaseInOut"
|
||||
IterationCount="INFINITE">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="45" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="405" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
<StyleInclude Source="avares://FileTime.GuiApp/Resources/Styles.axaml" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using FileTime.App.Core.Services;
|
||||
using FileTime.App.Core.ViewModels;
|
||||
using FileTime.GuiApp.Configuration;
|
||||
using FileTime.GuiApp.IconProviders;
|
||||
using FileTime.GuiApp.Logging;
|
||||
using FileTime.GuiApp.Services;
|
||||
using FileTime.GuiApp.ViewModels;
|
||||
@@ -33,6 +34,7 @@ public static class Startup
|
||||
.AddSingleton<IRapidTravelModeKeyInputHandler, RapidTravelModeKeyInputHandler>()
|
||||
.AddSingleton<IStartupHandler, RootDriveInfoService>()
|
||||
.AddSingleton<LifecycleService>()
|
||||
.AddSingleton<IIconProvider, MaterialIconProvider>()
|
||||
.AddSingleton<IModalService, ModalService>();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Svg.Skia;
|
||||
using FileTime.App.Core.ViewModels;
|
||||
using FileTime.Core.Models;
|
||||
using FileTime.GuiApp.IconProviders;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace FileTime.GuiApp.Converters;
|
||||
|
||||
public class ItemToImageConverter : IValueConverter
|
||||
{
|
||||
private readonly IIconProvider _iconProvider;
|
||||
|
||||
public ItemToImageConverter()
|
||||
{
|
||||
_iconProvider = DI.ServiceProvider.GetRequiredService<IIconProvider>();
|
||||
}
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value == null) return null;
|
||||
|
||||
IItem item = value switch
|
||||
{
|
||||
IContainerViewModel container => container.Container!,
|
||||
IElementViewModel element => element.Element!,
|
||||
IItem i => i,
|
||||
_ => throw new NotImplementedException()
|
||||
};
|
||||
|
||||
SvgSource? source;
|
||||
try
|
||||
{
|
||||
var path = _iconProvider.GetImage(item)!;
|
||||
if (path.Type == Models.ImagePathType.Absolute)
|
||||
{
|
||||
source = SvgSource.Load<SvgSource>(path.Path!, null);
|
||||
}
|
||||
else if (path.Type == Models.ImagePathType.Raw)
|
||||
{
|
||||
return path.Image;
|
||||
}
|
||||
else
|
||||
{
|
||||
source = SvgSource.Load<SvgSource>("avares://FileTime.GuiApp" + path.Path, null);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
source = SvgSource.Load<SvgSource>("avares://FileTime.GuiApp/Assets/material/file.svg", null);
|
||||
}
|
||||
|
||||
return new SvgImage {Source = source};
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Syroot.Windows.IO.KnownFolders" Version="1.3.0" />
|
||||
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
using FileTime.GuiApp.Models;
|
||||
|
||||
namespace FileTime.GuiApp.IconProviders;
|
||||
|
||||
public class SpecialPathWithIcon
|
||||
{
|
||||
public string Path { get; }
|
||||
public ImagePath IconPath { get; }
|
||||
|
||||
public SpecialPathWithIcon(string path, ImagePath iconPath)
|
||||
{
|
||||
Path = path;
|
||||
IconPath = iconPath;
|
||||
}
|
||||
}
|
||||
50
src/GuiApp/Avalonia/FileTime.GuiApp/Resources/Brushes.axaml
Normal file
50
src/GuiApp/Avalonia/FileTime.GuiApp/Resources/Brushes.axaml
Normal file
@@ -0,0 +1,50 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<LinearGradientBrush x:Key="ContentSeparatorBrush">
|
||||
<GradientStop Color="#0093a1a1" Offset="0" />
|
||||
<GradientStop Color="#93a1a1" Offset="0.5" />
|
||||
<GradientStop Color="#0093a1a1" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="ContainerGradientBackgroundBrush">
|
||||
<GradientStop Color="#00b58900" Offset="0" />
|
||||
<GradientStop Color="#CCb58900" Offset="0.4" />
|
||||
<GradientStop Color="#CCb58900" Offset="0.6" />
|
||||
<GradientStop Color="#00b58900" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource AppBackgroundColor}" x:Key="AppBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource ContainerBackgroundColor}" x:Key="ContainerBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource TransparentContainerBackgroundColor}"
|
||||
x:Key="TransparentContainerBackgroundBrush" />
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource ItemBackgroundColor}" x:Key="ItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AlternativeItemBackgroundColor}"
|
||||
x:Key="AlternativeItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemBackgroundColor}" x:Key="SelectedItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedItemBackgroundColor}" x:Key="MarkedItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedSelectedItemBackgroundColor}"
|
||||
x:Key="MarkedSelectedItemBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedAlternativeItemBackgroundColor}"
|
||||
x:Key="MarkedAlternativeItemBackgroundBrush" />
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource ForegroundColor}" x:Key="ForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AccentColor}" x:Key="AccentBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AccentComplementColor}" x:Key="AccentComplementBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource LightForegroundColor}" x:Key="LightForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource AlternativeItemForegroundColor}"
|
||||
x:Key="AlternativeItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemForegroundColor}" x:Key="SelectedItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedItemForegroundColor}" x:Key="MarkedItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedAlternativeItemForegroundColor}"
|
||||
x:Key="MarkedAlternativeItemForegroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource MarkedSelectedItemForegroundColor}"
|
||||
x:Key="MarkedSelectedItemForegroundBrush" />
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource ErrorColor}" x:Key="ErrorBrush" />
|
||||
|
||||
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemBackgroundColor}"
|
||||
x:Key="SystemControlHighlightListAccentLowBrush" />
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,34 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="using:FileTime.GuiApp.Converters">
|
||||
<converters:ItemViewModeToBrushConverter
|
||||
AlternativeBrush="{StaticResource AlternativeItemForegroundBrush}"
|
||||
DefaultBrush="{StaticResource ForegroundBrush}"
|
||||
MarkedAlternativeBrush="{StaticResource MarkedAlternativeItemForegroundBrush}"
|
||||
MarkedBrush="{StaticResource MarkedItemForegroundBrush}"
|
||||
MarkedSelectedBrush="{StaticResource MarkedSelectedItemForegroundBrush}"
|
||||
SelectedBrush="{StaticResource SelectedItemForegroundBrush}"
|
||||
x:Key="ItemViewModeToForegroundConverter" />
|
||||
<converters:ItemViewModeToBrushConverter
|
||||
AlternativeBrush="{StaticResource AlternativeItemBackgroundBrush}"
|
||||
DefaultBrush="{StaticResource ItemBackgroundBrush}"
|
||||
MarkedAlternativeBrush="{StaticResource MarkedAlternativeItemBackgroundBrush}"
|
||||
MarkedBrush="{StaticResource MarkedItemBackgroundBrush}"
|
||||
MarkedSelectedBrush="{StaticResource MarkedSelectedItemBackgroundBrush}"
|
||||
SelectedBrush="{StaticResource SelectedItemBackgroundBrush}"
|
||||
x:Key="ItemViewModeToBackgroundConverter" />
|
||||
<converters:NamePartShrinkerConverter x:Key="NamePartShrinkerConverter" />
|
||||
<converters:ItemViewModelIsAttributeTypeConverter x:Key="ItemViewModelIsAttributeTypeConverter" />
|
||||
<converters:ItemViewModelIsAttributeTypeConverter Invert="true"
|
||||
x:Key="ItemViewModelIsNotAttributeTypeConverter" />
|
||||
<converters:GetFileExtensionConverter x:Key="GetFileExtensionConverter" />
|
||||
<converters:FormatSizeConverter x:Key="FormatSizeConverter" />
|
||||
<converters:DateTimeConverter x:Key="DateTimeConverter" />
|
||||
<converters:SplitStringConverter x:Key="SplitStringConverter" />
|
||||
<converters:CompareConverter x:Key="EqualityConverter" />
|
||||
<converters:CompareConverter ComparisonCondition="{x:Static converters:ComparisonCondition.NotEqual}"
|
||||
x:Key="NotEqualsConverter" />
|
||||
<converters:ExceptionToStringConverter x:Key="ExceptionToStringConverter" />
|
||||
<converters:CommandToCommandNameConverter x:Key="CommandToCommandNameConverter" />
|
||||
<converters:ItemToImageConverter x:Key="ItemToImageConverter" />
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,27 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Color x:Key="AppBackgroundColor">#E7073642</Color>
|
||||
<Color x:Key="ContainerBackgroundColor">#083e4c</Color>
|
||||
<Color x:Key="TransparentContainerBackgroundColor">#D0083e4c</Color>
|
||||
<Color x:Key="BarelyTransparentBackgroundColor">#80083e4c</Color>
|
||||
|
||||
<Color x:Key="ItemBackgroundColor">#00000000</Color>
|
||||
<Color x:Key="AlternativeItemBackgroundColor">#10000000</Color>
|
||||
<Color x:Key="SelectedItemBackgroundColor">#93a1a1</Color>
|
||||
<Color x:Key="MarkedItemBackgroundColor">#00000000</Color>
|
||||
<Color x:Key="MarkedAlternativeItemBackgroundColor">#10000000</Color>
|
||||
<Color x:Key="MarkedSelectedItemBackgroundColor">#b58900</Color>
|
||||
|
||||
<Color x:Key="ForegroundColor">#93a1a1</Color>
|
||||
<Color x:Key="AccentColor">#268bd2</Color>
|
||||
<Color x:Key="AccentComplementColor">#fdf6e3</Color>
|
||||
<Color x:Key="LightForegroundColor">#7793a1a1</Color>
|
||||
<Color x:Key="AlternativeItemForegroundColor">#93a1a1</Color>
|
||||
<Color x:Key="SelectedItemForegroundColor">#073642</Color>
|
||||
<Color x:Key="MarkedItemForegroundColor">#b58900</Color>
|
||||
<Color x:Key="MarkedAlternativeItemForegroundColor">#b58900</Color>
|
||||
<Color x:Key="MarkedSelectedItemForegroundColor">#002b36</Color>
|
||||
|
||||
<Color x:Key="ErrorColor">#dc322f</Color>
|
||||
</ResourceDictionary>
|
||||
81
src/GuiApp/Avalonia/FileTime.GuiApp/Resources/Styles.axaml
Normal file
81
src/GuiApp/Avalonia/FileTime.GuiApp/Resources/Styles.axaml
Normal file
@@ -0,0 +1,81 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<FluentTheme Mode="Dark" />
|
||||
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.SmallText">
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.ExtraSmallText">
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
</Style>
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ContainerBackgroundBrush}" />
|
||||
</Style>
|
||||
<Style Selector="ListBox.ContentListView">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
<Style Selector="ListBox.ContentListView > ListBoxItem">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<!--Setter Property="ContextMenu">
|
||||
<ContextMenu Items="{Binding Converter={StaticResource ContextMenuGenerator}}"/>
|
||||
</Setter-->
|
||||
</Style>
|
||||
|
||||
<Style Selector="Grid.SidebarContainerPresenter">
|
||||
<Setter Property="Background" Value="#01000000" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Grid.SidebarContainerPresenter:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBackgroundColor}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Border.SelectedTimelineCommand">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ForegroundBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="ListBox.RadioButtonListBox">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="ListBox.RadioButtonListBox ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border>
|
||||
<RadioButton
|
||||
Content="{TemplateBinding ContentPresenter.Content}"
|
||||
Foreground="{DynamicResource ForegroundBrush}"
|
||||
IsChecked="{Binding Path=IsSelected, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
VerticalAlignment="Center" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Image.LoadingAnimation">
|
||||
<Style.Animations>
|
||||
<Animation
|
||||
Duration="0:0:2"
|
||||
Easing="QuadraticEaseInOut"
|
||||
IterationCount="INFINITE">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="45" />
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="405" />
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Styles>
|
||||
@@ -19,12 +19,12 @@
|
||||
<Setter x:CompileBindings="False" Property="Foreground" Value="{Binding DataContext.ViewMode^,Converter={StaticResource ItemViewModeToForegroundConverter},ElementName=ItemRoot}"/>
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<!--Image
|
||||
<Image
|
||||
Width="18"
|
||||
Height="18"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Source="{Binding Converter={StaticResource ItemToImageConverter}}" /-->
|
||||
Source="{Binding Converter={StaticResource ItemToImageConverter}}" />
|
||||
|
||||
<ItemsControl
|
||||
Margin="5,0,0,0"
|
||||
|
||||
Reference in New Issue
Block a user