Show children
This commit is contained in:
@@ -1,218 +1,185 @@
|
||||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:FileTime.GuiApp"
|
||||
x:Class="FileTime.GuiApp.App"
|
||||
xmlns:converters="using:FileTime.GuiApp.Converters">
|
||||
<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>
|
||||
<Application
|
||||
x:Class="FileTime.GuiApp.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:converters="using:FileTime.GuiApp.Converters"
|
||||
xmlns:local="using:FileTime.GuiApp"
|
||||
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="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="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>
|
||||
<Color x:Key="ErrorColor">#dc322f</Color>
|
||||
|
||||
<LinearGradientBrush x:Key="ContentSeparatorBrush">
|
||||
<GradientStop Offset="0" Color="#0093a1a1" />
|
||||
<GradientStop Offset="0.5" Color="#93a1a1" />
|
||||
<GradientStop Offset="1" Color="#0093a1a1" />
|
||||
</LinearGradientBrush>
|
||||
<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 Offset="0" Color="#00b58900" />
|
||||
<GradientStop Offset="0.4" Color="#CCb58900" />
|
||||
<GradientStop Offset="0.6" Color="#CCb58900" />
|
||||
<GradientStop Offset="1" Color="#00b58900" />
|
||||
</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
|
||||
x:Key="AppBackgroundBrush"
|
||||
Color="{DynamicResource AppBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="ContainerBackgroundBrush"
|
||||
Color="{DynamicResource ContainerBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="TransparentContainerBackgroundBrush"
|
||||
Color="{DynamicResource TransparentContainerBackgroundColor}" />
|
||||
<SolidColorBrush Color="{DynamicResource AppBackgroundColor}" x:Key="AppBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource ContainerBackgroundColor}" x:Key="ContainerBackgroundBrush" />
|
||||
<SolidColorBrush Color="{DynamicResource TransparentContainerBackgroundColor}" x:Key="TransparentContainerBackgroundBrush" />
|
||||
|
||||
<SolidColorBrush
|
||||
x:Key="ItemBackgroundBrush"
|
||||
Color="{DynamicResource ItemBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="AlternativeItemBackgroundBrush"
|
||||
Color="{DynamicResource AlternativeItemBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="SelectedItemBackgroundBrush"
|
||||
Color="{DynamicResource SelectedItemBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="MarkedItemBackgroundBrush"
|
||||
Color="{DynamicResource MarkedItemBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="MarkedSelectedItemBackgroundBrush"
|
||||
Color="{DynamicResource MarkedSelectedItemBackgroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="MarkedAlternativeItemBackgroundBrush"
|
||||
Color="{DynamicResource MarkedAlternativeItemBackgroundColor}" />
|
||||
<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
|
||||
x:Key="ForegroundBrush"
|
||||
Color="{DynamicResource ForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="AccentBrush"
|
||||
Color="{DynamicResource AccentColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="AccentComplementBrush"
|
||||
Color="{DynamicResource AccentComplementColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="LightForegroundBrush"
|
||||
Color="{DynamicResource LightForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="AlternativeItemForegroundBrush"
|
||||
Color="{DynamicResource AlternativeItemForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="SelectedItemForegroundBrush"
|
||||
Color="{DynamicResource SelectedItemForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="MarkedItemForegroundBrush"
|
||||
Color="{DynamicResource MarkedItemForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="MarkedAlternativeItemForegroundBrush"
|
||||
Color="{DynamicResource MarkedAlternativeItemForegroundColor}" />
|
||||
<SolidColorBrush
|
||||
x:Key="MarkedSelectedItemForegroundBrush"
|
||||
Color="{DynamicResource MarkedSelectedItemForegroundColor}" />
|
||||
<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
|
||||
x:Key="ErrorBrush"
|
||||
Color="{DynamicResource ErrorColor}" />
|
||||
<SolidColorBrush Color="{DynamicResource ErrorColor}" x:Key="ErrorBrush" />
|
||||
|
||||
|
||||
<SolidColorBrush x:Key="SystemControlHighlightListAccentLowBrush" Color="{DynamicResource SelectedItemBackgroundColor}" />
|
||||
<SolidColorBrush Color="{DynamicResource SelectedItemBackgroundColor}" x:Key="SystemControlHighlightListAccentLowBrush" />
|
||||
|
||||
|
||||
|
||||
<converters:ItemViewModeToBrushConverter
|
||||
x:Key="ItemViewModeToForegroundConverter"
|
||||
DefaultBrush="{StaticResource ForegroundBrush}"
|
||||
AlternativeBrush="{StaticResource AlternativeItemForegroundBrush}"
|
||||
SelectedBrush="{StaticResource SelectedItemForegroundBrush}"
|
||||
MarkedBrush="{StaticResource MarkedItemForegroundBrush}"
|
||||
MarkedAlternativeBrush="{StaticResource MarkedAlternativeItemForegroundBrush}"
|
||||
MarkedSelectedBrush="{StaticResource MarkedSelectedItemForegroundBrush}"/>
|
||||
<converters:ItemViewModeToBrushConverter
|
||||
x:Key="ItemViewModeToBackgroundConverter"
|
||||
DefaultBrush="{StaticResource ItemBackgroundBrush}"
|
||||
AlternativeBrush="{StaticResource AlternativeItemBackgroundBrush}"
|
||||
SelectedBrush="{StaticResource SelectedItemBackgroundBrush}"
|
||||
MarkedBrush="{StaticResource MarkedItemBackgroundBrush}"
|
||||
MarkedAlternativeBrush="{StaticResource MarkedAlternativeItemBackgroundBrush}"
|
||||
MarkedSelectedBrush="{StaticResource MarkedSelectedItemBackgroundBrush}"/>
|
||||
<converters:NamePartShrinkerConverter x:Key="NamePartShrinkerConverter"/>
|
||||
<converters:ItemViewModelIsAttributeTypeConverter x:Key="ItemViewModelIsAttributeTypeConverter"/>
|
||||
<converters:ItemViewModelIsAttributeTypeConverter x:Key="ItemViewModelIsNotAttributeTypeConverter" Invert="true"/>
|
||||
<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 x:Key="NotEqualsConverter" ComparisonCondition="{x:Static converters:ComparisonCondition.NotEqual}"/>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
<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" />
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
<Application.Styles>
|
||||
<FluentTheme Mode="Dark"/>
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<Style Selector="Grid.SidebarContainerPresenter">
|
||||
<Setter Property="Background" Value="#01000000"/>
|
||||
</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="Grid.SidebarContainerPresenter:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource AppBackgroundColor}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="Border.SelectedTimelineCommand">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ForegroundBrush}"/>
|
||||
</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}"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding Path=IsSelected,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
|
||||
Foreground="{DynamicResource ForegroundBrush}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</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" IterationCount="INFINITE" Easing="QuadraticEaseInOut">
|
||||
<KeyFrame Cue="0%">
|
||||
<Setter Property="RotateTransform.Angle" Value="45"/>
|
||||
</KeyFrame>
|
||||
<KeyFrame Cue="100%">
|
||||
<Setter Property="RotateTransform.Angle" Value="405"/>
|
||||
</KeyFrame>
|
||||
</Animation>
|
||||
</Style.Animations>
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
<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>
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace FileTime.GuiApp.Converters
|
||||
{
|
||||
public class ExceptionToStringConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not Exception e) return value;
|
||||
|
||||
if (e is UnauthorizedAccessException)
|
||||
{
|
||||
return e.Message;
|
||||
}
|
||||
else if (e.InnerException != null)
|
||||
{
|
||||
return TraverseInnerException(e);
|
||||
}
|
||||
|
||||
return FormatException(e);
|
||||
}
|
||||
|
||||
private static string TraverseInnerException(Exception e)
|
||||
{
|
||||
string s = "";
|
||||
if (e.InnerException != null) s += TraverseInnerException(e.InnerException) + Environment.NewLine;
|
||||
else return FormatException(e);
|
||||
|
||||
s += "In: " + FormatException(e);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
private static string FormatException(Exception e)
|
||||
{
|
||||
return $"{e.Message} ({e.GetType().FullName})";
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,145 +1,208 @@
|
||||
<Window 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:vm="using:FileTime.GuiApp.ViewModels"
|
||||
xmlns:corevm="using:FileTime.App.Core.ViewModels"
|
||||
xmlns:local="using:FileTime.GuiApp.Views"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
InputElement.KeyDown="OnKeyDown"
|
||||
Opened="OnWindowOpened"
|
||||
x:Class="FileTime.GuiApp.Views.MainWindow"
|
||||
Icon="/Assets/filetime.ico"
|
||||
Title="FileTime"
|
||||
TransparencyLevelHint="Blur"
|
||||
Background="Transparent"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
x:DataType="vm:IMainWindowViewModelBase"
|
||||
x:CompileBindings="True">
|
||||
<Window
|
||||
Background="Transparent"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
Icon="/Assets/filetime.ico"
|
||||
InputElement.KeyDown="OnKeyDown"
|
||||
Opened="OnWindowOpened"
|
||||
Title="FileTime"
|
||||
TransparencyLevelHint="Blur"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="FileTime.GuiApp.Views.MainWindow"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:IMainWindowViewModelBase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:corevm="using:FileTime.App.Core.ViewModels"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:FileTime.GuiApp.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:FileTime.GuiApp.ViewModels"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Design.DataContext>
|
||||
<vm:MainWindowViewModel />
|
||||
</Design.DataContext>
|
||||
|
||||
<Grid Background="{DynamicResource AppBackgroundBrush}">
|
||||
<Grid IsVisible="{Binding Loading, Converter={x:Static BoolConverters.Not}}" x:DataType="vm:MainWindowViewModel">
|
||||
<Grid ColumnDefinitions="250,*" RowDefinitions="Auto,*">
|
||||
<Grid PointerPressed="HeaderPointerPressed">
|
||||
<Rectangle Fill="#01000000"/>
|
||||
<TextBlock Margin="15,10" Text="{Binding Title}"/>
|
||||
</Grid>
|
||||
<Grid Background="{DynamicResource AppBackgroundBrush}">
|
||||
<Grid IsVisible="{Binding Loading, Converter={x:Static BoolConverters.Not}}" x:DataType="vm:MainWindowViewModel">
|
||||
<Grid ColumnDefinitions="250,*" RowDefinitions="Auto,*">
|
||||
<Grid PointerPressed="HeaderPointerPressed">
|
||||
<Rectangle Fill="#01000000" />
|
||||
<TextBlock Margin="15,10" Text="{Binding Title}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" PointerPressed="HeaderPointerPressed">
|
||||
<Rectangle Fill="#01000000"/>
|
||||
<Grid Grid.Column="1" PointerPressed="HeaderPointerPressed">
|
||||
<Rectangle Fill="#01000000" />
|
||||
|
||||
<StackPanel Margin="20,10" Orientation="Horizontal">
|
||||
<!--local:PathPresenter DataContext="{Binding AppState.SelectedTab^.CurrentLocation^.FullName.Path,Converter={StaticResource PathPreformatter}}"/-->
|
||||
<TextBlock
|
||||
Text="{Binding AppState.SelectedTab^.CurrentSelectedItem^.DisplayNameText}" Foreground="{StaticResource AccentBrush}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel Margin="20,10" Orientation="Horizontal">
|
||||
<!-- local:PathPresenter DataContext="{Binding AppState.SelectedTab^.CurrentLocation^.FullName.Path,Converter={StaticResource PathPreformatter}}"/ -->
|
||||
<TextBlock Foreground="{StaticResource AccentBrush}" Text="{Binding AppState.SelectedTab^.CurrentSelectedItem^.DisplayNameText}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="1" RowDefinitions="Auto,40,*,Auto">
|
||||
<Grid
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
RowDefinitions="Auto,40,*,Auto">
|
||||
|
||||
<ItemsControl
|
||||
Grid.Row="1"
|
||||
Items="{Binding AppState.Tabs}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid RowDefinitions="Auto,1">
|
||||
<StackPanel Orientation="Horizontal" Margin="20,0,20,0">
|
||||
<ItemsControl Grid.Row="1" Items="{Binding AppState.Tabs}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid RowDefinitions="Auto,1">
|
||||
<StackPanel Margin="20,0,20,0" Orientation="Horizontal">
|
||||
|
||||
<TextBlock
|
||||
VerticalAlignment="Center" Text="{Binding TabNumber,StringFormat=({0})}" />
|
||||
<TextBlock Text="{Binding TabNumber, StringFormat=({0})}" VerticalAlignment="Center" />
|
||||
|
||||
<TextBlock
|
||||
VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding CurrentLocation^.Name}" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
Text="{Binding CurrentLocation^.Name}"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
|
||||
<Rectangle Fill="{DynamicResource ForegroundBrush}" Grid.Row="1" IsVisible="{Binding IsSelected^}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Rectangle
|
||||
Fill="{DynamicResource ForegroundBrush}"
|
||||
Grid.Row="1"
|
||||
IsVisible="{Binding IsSelected^}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
<Grid
|
||||
Grid.Row="2"
|
||||
Margin="20,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="15*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="40*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="45*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Row="2" Margin="20,0,0,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="15*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="40*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="45*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Rectangle
|
||||
Grid.Column="1"
|
||||
Width="1"
|
||||
Margin="0,10,0,10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
<Rectangle
|
||||
Fill="{DynamicResource ContentSeparatorBrush}"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,10,0,10"
|
||||
VerticalAlignment="Stretch"
|
||||
Width="1" />
|
||||
|
||||
|
||||
<Grid Grid.Column="2" RowDefinitions="Auto,*">
|
||||
<Grid IsVisible="{Binding AppState.SelectedTab^.CurrentLocation^.IsLoading^}">
|
||||
<Image Width="40" Height="40" Source="{SvgImage /Assets/loading.svg}" Classes="LoadingAnimation"/>
|
||||
</Grid>
|
||||
<ListBox
|
||||
Grid.Row="1"
|
||||
x:Name="CurrentItems"
|
||||
x:CompileBindings="False"
|
||||
AutoScrollToSelectedItem="True"
|
||||
IsTabStop="True"
|
||||
Items="{Binding AppState.SelectedTab^.CurrentItems^}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
Classes="ContentListView">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="corevm:IItemViewModel">
|
||||
<local:ItemView HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Grid Grid.Column="2" RowDefinitions="Auto,*">
|
||||
<Grid IsVisible="{Binding AppState.SelectedTab^.CurrentLocation^.IsLoading^}">
|
||||
<Image
|
||||
Classes="LoadingAnimation"
|
||||
Height="40"
|
||||
Source="{SvgImage /Assets/loading.svg}"
|
||||
Width="40" />
|
||||
</Grid>
|
||||
<ListBox
|
||||
AutoScrollToSelectedItem="True"
|
||||
Classes="ContentListView"
|
||||
Grid.Row="1"
|
||||
IsTabStop="True"
|
||||
Items="{Binding AppState.SelectedTab^.CurrentItems^}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
x:CompileBindings="False"
|
||||
x:Name="CurrentItems">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="corevm:IItemViewModel">
|
||||
<local:ItemView HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
x:CompileBindings="False"
|
||||
x:Name="CurrentEmpty"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource ErrorBrush}"
|
||||
IsVisible="{Binding AppState.SelectedTab^.CurrentLocation^.Items^.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
||||
Empty
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource ErrorBrush}"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
IsVisible="{Binding AppState.SelectedTab^.CurrentLocation^.Items^.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}"
|
||||
Margin="10"
|
||||
x:CompileBindings="False"
|
||||
x:Name="CurrentEmpty">
|
||||
Empty
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
<Rectangle
|
||||
Grid.Column="3"
|
||||
Width="1"
|
||||
Margin="0,10,0,10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
<Rectangle
|
||||
Fill="{DynamicResource ContentSeparatorBrush}"
|
||||
Grid.Column="3"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,10,0,10"
|
||||
VerticalAlignment="Stretch"
|
||||
Width="1" />
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<!--Borders-->
|
||||
<Grid Grid.Column="4">
|
||||
<Grid IsVisible="{Binding AppState.SelectedTab^.SelectedsChildren^, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<ListBox
|
||||
AutoScrollToSelectedItem="True"
|
||||
Classes="ContentListView"
|
||||
IsVisible="{Binding AppState.SelectedTab^.SelectedsChildren^.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}"
|
||||
Items="{Binding AppState.SelectedTab^.SelectedsChildren^}"
|
||||
x:CompileBindings="False"
|
||||
x:Name="ChildItems">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="corevm:IItemViewModel">
|
||||
<local:ItemView />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
</Grid>
|
||||
<TextBlock
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource ErrorBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
IsVisible="{Binding AppState.SelectedTab^.SelectedsChildren^.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}"
|
||||
Margin="10"
|
||||
x:CompileBindings="False"
|
||||
x:Name="ChildEmpty">
|
||||
Empty
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
<Grid IsVisible="{Binding Loading}">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Image Source="/Assets/filetime.ico" Width="128" Height="128"/>
|
||||
<TextBlock Text="Loading..." HorizontalAlignment="Center" Margin="50"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
<Grid IsVisible="{Binding AppState.SelectedTab^.SelectedsChildren^, Converter={x:Static ObjectConverters.IsNull}, ConverterParameter=0}" RowDefinitions="Auto, Auto">
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource ErrorBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,0,0,10"
|
||||
Text="There were some errors while opening container."
|
||||
TextWrapping="Wrap" />
|
||||
|
||||
<ItemsRepeater Grid.Row="1" Items="{Binding AppState.SelectedTab^.CurrentSelectedItem^.BaseItem.Exceptions^}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Margin="5,0,5,10" Text="{Binding Converter={StaticResource ExceptionToStringConverter}}" />
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<!-- Borders -->
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid IsVisible="{Binding Loading}">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Image
|
||||
Height="128"
|
||||
Source="/Assets/filetime.ico"
|
||||
Width="128" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Margin="50"
|
||||
Text="Loading..." />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user