Browse Source

Avalonia style updates

Ruben 1 year ago
parent
commit
f6909268b1
33 changed files with 312 additions and 59 deletions
  1. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Black.ttf
  2. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Bold.ttf
  3. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Italic.ttf
  4. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Light.ttf
  5. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-LightItalic.ttf
  6. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Medium.ttf
  7. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-MediumItalic.ttf
  8. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Regular.ttf
  9. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Thin.ttf
  10. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-ThinItalic.ttf
  11. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/texgyreheros-bold.otf
  12. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/texgyreheros-italic.otf
  13. 0 0
      src/PicView.Avalonia.Theme/Assets/Fonts/texgyreheros-regular.otf
  14. 0 0
      src/PicView.Avalonia.Theme/Controls/Border.axaml
  15. 18 0
      src/PicView.Avalonia.Theme/Controls/Button.axaml
  16. 19 0
      src/PicView.Avalonia.Theme/Controls/ItemsControl.axaml
  17. 23 0
      src/PicView.Avalonia.Theme/Controls/PathIcon.axaml
  18. 0 0
      src/PicView.Avalonia.Theme/Controls/TextBlock.axaml
  19. 10 5
      src/PicView.Avalonia.Theme/Controls/Window.axaml
  20. 19 9
      src/PicView.Avalonia.Theme/Dark/DarkTheme.axaml
  21. 0 0
      src/PicView.Avalonia.Theme/Dark/Resources/noisy-texture-200x200-o4-d31-c-161616-t0.png
  22. 7 0
      src/PicView.Avalonia.Theme/DarkTheme.xaml
  23. 13 0
      src/PicView.Avalonia.Theme/DarkTheme.xaml.cs
  24. 23 0
      src/PicView.Avalonia.Theme/IBitmapToImageConverter.cs
  25. 114 0
      src/PicView.Avalonia.Theme/PicView.Avalonia.Theme.csproj
  26. 2 2
      src/PicView.Avalonia.Win32/App.axaml
  27. 1 0
      src/PicView.Avalonia.Win32/PicView.Avalonia.Win32.csproj
  28. 20 6
      src/PicView.Avalonia.Win32/Views/MainWindow.axaml
  29. 1 0
      src/PicView.Avalonia.Win32/Views/MainWindow.axaml.cs
  30. 6 1
      src/PicView.Avalonia.Win32/Views/WinTitleBar.axaml
  31. 8 18
      src/PicView.Avalonia/PicView.Avalonia.csproj
  32. 22 18
      src/PicView.Avalonia/Views/TitleTextBox.axaml
  33. 6 0
      src/PicView.sln

+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Black.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Black.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Bold.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Bold.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Italic.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Italic.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Light.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Light.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-LightItalic.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-LightItalic.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Medium.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Medium.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-MediumItalic.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-MediumItalic.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Regular.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Regular.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-Thin.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-Thin.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/Roboto-ThinItalic.ttf → src/PicView.Avalonia.Theme/Assets/Fonts/Roboto-ThinItalic.ttf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/texgyreheros-bold.otf → src/PicView.Avalonia.Theme/Assets/Fonts/texgyreheros-bold.otf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/texgyreheros-italic.otf → src/PicView.Avalonia.Theme/Assets/Fonts/texgyreheros-italic.otf


+ 0 - 0
src/PicView.Avalonia/Assets/Fonts/texgyreheros-regular.otf → src/PicView.Avalonia.Theme/Assets/Fonts/texgyreheros-regular.otf


+ 0 - 0
src/PicView.Avalonia/Themes/Controls/Border.axaml → src/PicView.Avalonia.Theme/Controls/Border.axaml


+ 18 - 0
src/PicView.Avalonia/Themes/Controls/Button.axaml → src/PicView.Avalonia.Theme/Controls/Button.axaml

@@ -22,5 +22,23 @@
                     TextElement.Foreground="{TemplateBinding Foreground}" />
             </ControlTemplate>
         </Setter>
+        <Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
+            <!--<Style.Animations>
+                <Animation IterationCount="1" Duration=".35">
+                    <KeyFrame Cue="100%">
+                        <Setter Property="Background">
+                            <SolidColorBrush Color="{DynamicResource AccentColor}" />
+                        </Setter>
+                    </KeyFrame>
+                </Animation>
+            </Style.Animations>-->
+            <Setter Property="Background" Value="{DynamicResource AccentColor}" />
+        </Style>
+        <Style Selector="^:pressed  /template/ ContentPresenter#PART_ContentPresenter">
+            <Setter Property="Background" Value="{DynamicResource SecondaryAccentColor}" />
+        </Style>
+        <Style Selector="^:disabled">
+            <Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
+        </Style>
     </ControlTheme>
 </ResourceDictionary>

+ 19 - 0
src/PicView.Avalonia.Theme/Controls/ItemsControl.axaml

@@ -0,0 +1,19 @@
+<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Design.PreviewWith>
+        <ItemsControl />
+    </Design.PreviewWith>
+    <ControlTheme x:Key="{x:Type ItemsControl}" TargetType="ItemsControl">
+        <Setter Property="Template">
+            <ControlTemplate>
+                <Border
+                    Padding="{TemplateBinding Padding}"
+                    Background="{TemplateBinding Background}"
+                    BorderBrush="{TemplateBinding BorderBrush}"
+                    BorderThickness="{TemplateBinding BorderThickness}"
+                    CornerRadius="{TemplateBinding CornerRadius}">
+                    <ItemsPresenter Name="PART_ItemsPresenter" ItemsPanel="{TemplateBinding ItemsPanel}" />
+                </Border>
+            </ControlTemplate>
+        </Setter>
+    </ControlTheme>
+</ResourceDictionary>

+ 23 - 0
src/PicView.Avalonia.Theme/Controls/PathIcon.axaml

@@ -0,0 +1,23 @@
+<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Design.PreviewWith>
+        <PathIcon />
+    </Design.PreviewWith>
+    <ControlTheme x:Key="{x:Type PathIcon}" TargetType="PathIcon">
+        <Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Height" Value="{TemplateBinding Height}" />
+        <Setter Property="Width" Value="{TemplateBinding Width}" />
+        <Setter Property="Template">
+            <ControlTemplate>
+                <Border Background="{TemplateBinding Background}">
+                    <Viewbox Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
+                        <Path
+                            Data="{TemplateBinding Data}"
+                            Fill="{TemplateBinding Foreground}"
+                            Stretch="Uniform" />
+                    </Viewbox>
+                </Border>
+            </ControlTemplate>
+        </Setter>
+    </ControlTheme>
+</ResourceDictionary>

+ 0 - 0
src/PicView.Avalonia/Themes/Controls/TextBlock.axaml → src/PicView.Avalonia.Theme/Controls/TextBlock.axaml


+ 10 - 5
src/PicView.Avalonia/Themes/Controls/Window.axaml → src/PicView.Avalonia.Theme/Controls/Window.axaml

@@ -1,10 +1,15 @@
-<ResourceDictionary
-    xmlns="https://github.com/avaloniaui"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    x:CompileBindings="True">
+<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Design.PreviewWith>
+        <Window />
+    </Design.PreviewWith>
     <ControlTheme x:Key="{x:Type Window}" TargetType="Window">
+        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
+        <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
+        <Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource HighlightForegroundColor}" />
+        <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" />
+        <Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}" />
         <Setter Property="Template">
-            <ControlTemplate TargetType="Window">
+            <ControlTemplate>
                 <Panel>
                     <Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
                     <Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />

+ 19 - 9
src/PicView.Avalonia/Themes/Dark/DarkTheme.axaml → src/PicView.Avalonia.Theme/Dark/DarkTheme.axaml

@@ -2,7 +2,8 @@
     <Styles.Resources>
         <ResourceDictionary>
             <Color x:Key="AccentColor">#FFDB5B3D</Color>
-            <Color x:Key="SecondaryAccentColor">#FFf8af3c</Color>
+            <Color x:Key="SecondaryAccentColor">#e0755a</Color>
+            <Color x:Key="LogoAccentColor">#FFf8af3c</Color>
 
             <Color x:Key="MainTextColor">#FFf6f4f4</Color>
             <Color x:Key="MainTextColorFaded">#FFf6f4f4</Color>
@@ -17,19 +18,22 @@
 
             <Color x:Key="MainBorderColor">#FF3A3A3A</Color>
 
+            <Color x:Key="ButtonForegroundPointerOver">#FFF</Color>
+
             <ImageBrush
                 x:Key="NoisyTexture"
                 DestinationRect="0,0,100,100"
-                Opacity=".9"
-                Source="\Themes\Dark\Resources\noisy-texture-200x200-o4-d31-c-161616-t0.png"
+                Opacity=".7"
+                Source="\Dark\Resources\noisy-texture-200x200-o4-d31-c-161616-t0.png"
                 SourceRect="0,0,200,200"
                 Stretch="Fill"
                 TileMode="FlipXY" />
             <ResourceDictionary.MergedDictionaries>
-                <ResourceInclude Source="avares://PicView.Avalonia/Themes/Controls/Button.axaml" />
-                <ResourceInclude Source="avares://PicView.Avalonia/Themes/Controls/Border.axaml" />
-                <ResourceInclude Source="avares://PicView.Avalonia/Themes/Controls/TextBlock.axaml" />
-                <ResourceInclude Source="avares://PicView.Avalonia/Themes/Controls/Window.axaml" />
+                <ResourceInclude Source="/Controls/Button.axaml" />
+                <ResourceInclude Source="/Controls/Border.axaml" />
+                <ResourceInclude Source="/Controls/TextBlock.axaml" />
+                <ResourceInclude Source="/Controls/PathIcon.axaml" />
+                <ResourceInclude Source="/Controls/Window.axaml" />
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
     </Styles.Resources>
@@ -42,11 +46,17 @@
     </Style>
     <Style Selector="TextBox, Label, Button">
         <Setter Property="FontSize" Value="12" />
-        <Setter Property="FontFamily" Value="avares://PicView.Avalonia/Assets/Fonts#Roboto" />
+        <Setter Property="FontFamily" Value="/Assets/Fonts/Roboto-Regular.ttf#Roboto" />
     </Style>
     <Style Selector="TextBlock">
         <Setter Property="FontSize" Value="14" />
         <Setter Property="Foreground" Value="{StaticResource MainTextColor}" />
-        <Setter Property="FontFamily" Value="avares://PicView.Avalonia/Assets/Fonts#Roboto" />
+        <Setter Property="FontFamily" Value="/Assets/Fonts/Roboto-Regular.ttf#Roboto" />
+    </Style>
+
+    <Style Selector="Button.hover">
+        <Style Selector="^:pointerover">
+            <Setter Property="Background" Value="{DynamicResource AccentColor}" />
+        </Style>
     </Style>
 </Styles>

+ 0 - 0
src/PicView.Avalonia/Themes/Dark/Resources/noisy-texture-200x200-o4-d31-c-161616-t0.png → src/PicView.Avalonia.Theme/Dark/Resources/noisy-texture-200x200-o4-d31-c-161616-t0.png


+ 7 - 0
src/PicView.Avalonia.Theme/DarkTheme.xaml

@@ -0,0 +1,7 @@
+<Styles
+    x:Class="PicView.Avalonia.Theme.DarkTheme"
+    xmlns="https://github.com/avaloniaui"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <StyleInclude Source="/Dark/DarkTheme.axaml" />
+</Styles>

+ 13 - 0
src/PicView.Avalonia.Theme/DarkTheme.xaml.cs

@@ -0,0 +1,13 @@
+using System;
+using Avalonia.Markup.Xaml;
+using Avalonia.Styling;
+
+namespace PicView.Avalonia.Theme;
+
+public class DarkTheme : Styles
+{
+    public DarkTheme(IServiceProvider? sp = null)
+    {
+        AvaloniaXamlLoader.Load(sp, this);
+    }
+}

+ 23 - 0
src/PicView.Avalonia.Theme/IBitmapToImageConverter.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Globalization;
+using Avalonia.Controls;
+using Avalonia.Data.Converters;
+using Avalonia.Media.Imaging;
+
+namespace PicView.Avalonia.Theme;
+
+internal class BitmapToImageConverter : IValueConverter
+{
+    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+    {
+        if (value is Bitmap bm)
+            return new Image { Source = bm };
+
+        return null;
+    }
+
+    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+    {
+        throw new NotImplementedException();
+    }
+}

+ 114 - 0
src/PicView.Avalonia.Theme/PicView.Avalonia.Theme.csproj

@@ -0,0 +1,114 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net7.0</TargetFramework>
+    <Nullable>enable</Nullable>
+    <LangVersion>latest</LangVersion>
+  </PropertyGroup>
+
+  
+  <ItemGroup>
+    <AvaloniaResource Include="Assets\**" />
+  </ItemGroup>
+
+  
+  <ItemGroup>
+    <None Remove="Assets\Fonts\Roboto-Black.ttf" />
+    <None Remove="Assets\Fonts\Roboto-Bold.ttf" />
+    <None Remove="Assets\Fonts\Roboto-Italic.ttf" />
+    <None Remove="Assets\Fonts\Roboto-Light.ttf" />
+    <None Remove="Assets\Fonts\Roboto-LightItalic.ttf" />
+    <None Remove="Assets\Fonts\Roboto-Medium.ttf" />
+    <None Remove="Assets\Fonts\Roboto-MediumItalic.ttf" />
+    <None Remove="Assets\Fonts\Roboto-Regular.ttf" />
+    <None Remove="Assets\Fonts\Roboto-Thin.ttf" />
+    <None Remove="Assets\Fonts\Roboto-ThinItalic.ttf" />
+    <None Remove="Assets\Fonts\texgyreheros-bold.otf" />
+    <None Remove="Assets\Fonts\texgyreheros-italic.otf" />
+    <None Remove="Assets\Fonts\texgyreheros-regular.otf" />
+    <None Remove="Controls\AdornerLayer.xaml" />
+    <None Remove="Controls\AutoCompleteBox.xaml" />
+    <None Remove="Controls\Button.xaml" />
+    <None Remove="Controls\ButtonSpinner.xaml" />
+    <None Remove="Controls\Calendar.xaml" />
+    <None Remove="Controls\CalendarButton.xaml" />
+    <None Remove="Controls\CalendarDatePicker.xaml" />
+    <None Remove="Controls\CalendarDayButton.xaml" />
+    <None Remove="Controls\CalendarItem.xaml" />
+    <None Remove="Controls\CaptionButtons.xaml" />
+    <None Remove="Controls\Carousel.xaml" />
+    <None Remove="Controls\CheckBox.xaml" />
+    <None Remove="Controls\ComboBox.xaml" />
+    <None Remove="Controls\ComboBoxItem.xaml" />
+    <None Remove="Controls\ContextMenu.xaml" />
+    <None Remove="Controls\DataValidationErrors.xaml" />
+    <None Remove="Controls\DatePicker.xaml" />
+    <None Remove="Controls\DateTimePickerShared.xaml" />
+    <None Remove="Controls\DropDownButton.xaml" />
+    <None Remove="Controls\EmbeddableControlRoot.xaml" />
+    <None Remove="Controls\Expander.xaml" />
+    <None Remove="Controls\FlyoutPresenter.xaml" />
+    <None Remove="Controls\GridSplitter.xaml" />
+    <None Remove="Controls\HeaderedContentControl.xaml" />
+    <None Remove="Controls\ItemsControl.xaml" />
+    <None Remove="Controls\Label.xaml" />
+    <None Remove="Controls\ListBox.xaml" />
+    <None Remove="Controls\ListBoxItem.xaml" />
+    <None Remove="Controls\ManagedFileChooser.xaml" />
+    <None Remove="Controls\Menu.xaml" />
+    <None Remove="Controls\MenuFlyoutPresenter.xaml" />
+    <None Remove="Controls\MenuItem.xaml" />
+    <None Remove="Controls\NativeMenuBar.xaml" />
+    <None Remove="Controls\NotificationCard.xaml" />
+    <None Remove="Controls\NumericUpDown.xaml" />
+    <None Remove="Controls\OverlayPopupHost.xaml" />
+    <None Remove="Controls\PathIcon.xaml" />
+    <None Remove="Controls\PopupRoot.xaml" />
+    <None Remove="Controls\ProgressBar.xaml" />
+    <None Remove="Controls\RadioButton.xaml" />
+    <None Remove="Controls\RefreshContainer.xaml" />
+    <None Remove="Controls\RefreshVisualizer.xaml" />
+    <None Remove="Controls\RepeatButton.xaml" />
+    <None Remove="Controls\ScrollBar.xaml" />
+    <None Remove="Controls\ScrollViewer.xaml" />
+    <None Remove="Controls\SelectableTextBlock.xaml" />
+    <None Remove="Controls\Separator.xaml" />
+    <None Remove="Controls\SimpleControls.xaml" />
+    <None Remove="Controls\Slider.xaml" />
+    <None Remove="Controls\SplitButton.xaml" />
+    <None Remove="Controls\SplitView.xaml" />
+    <None Remove="Controls\TabControl.xaml" />
+    <None Remove="Controls\TabItem.xaml" />
+    <None Remove="Controls\TabStrip.xaml" />
+    <None Remove="Controls\TabStripItem.xaml" />
+    <None Remove="Controls\TextBox.xaml" />
+    <None Remove="Controls\TextSelectionHandle.xaml" />
+    <None Remove="Controls\ThemeVariantScope.xaml" />
+    <None Remove="Controls\TimePicker.xaml" />
+    <None Remove="Controls\TitleBar.xaml" />
+    <None Remove="Controls\ToggleButton.xaml" />
+    <None Remove="Controls\ToggleSwitch.xaml" />
+    <None Remove="Controls\ToolTip.xaml" />
+    <None Remove="Controls\TransitioningContentControl.xaml" />
+    <None Remove="Controls\TreeView.xaml" />
+    <None Remove="Controls\TreeViewItem.xaml" />
+    <None Remove="Controls\Window.xaml" />
+    <None Remove="Controls\WindowNotificationManager.xaml" />
+    <None Remove="DarkTheme.xaml" />
+    <None Remove="Dark\Resources\noisy-texture-200x200-o4-d31-c-161616-t0.png" />
+  </ItemGroup>
+
+  
+  <ItemGroup>
+    <AvaloniaResource Include="DarkTheme.xaml" />
+    <AvaloniaResource Include="Dark\Resources\noisy-texture-200x200-o4-d31-c-161616-t0.png" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
+    <PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
+    <PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
+    <PackageReference Include="Avalonia.ReactiveUI" Version="$(AvaloniaVersion)" />
+    <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
+    <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
+  </ItemGroup>
+</Project>

+ 2 - 2
src/PicView.Avalonia.Win32/App.axaml

@@ -3,9 +3,9 @@
     xmlns="https://github.com/avaloniaui"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     RequestedThemeVariant="Default">
-    <!--  "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options.  -->
 
     <Application.Styles>
-        <StyleInclude Source="avares://PicView.Avalonia/Themes/Dark/DarkTheme.axaml" />
+        <SimpleTheme />
+        <StyleInclude Source="avares://PicView.Avalonia.Theme/Dark/DarkTheme.axaml" />
     </Application.Styles>
 </Application>

+ 1 - 0
src/PicView.Avalonia.Win32/PicView.Avalonia.Win32.csproj

@@ -20,6 +20,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\PicView.Avalonia.Theme\PicView.Avalonia.Theme.csproj" />
     <ProjectReference Include="..\PicView.Avalonia\PicView.Avalonia.csproj" />
     <ProjectReference Include="..\PicView.Core\PicView.Core.csproj" />
     <ProjectReference Include="..\PicView.Windows\PicView.Windows.csproj" />

+ 20 - 6
src/PicView.Avalonia.Win32/Views/MainWindow.axaml

@@ -10,15 +10,29 @@
     Title="PicView.Avalonia"
     d:DesignHeight="450"
     d:DesignWidth="800"
+    Background="Transparent"
     ExtendClientAreaChromeHints="NoChrome"
     ExtendClientAreaTitleBarHeightHint="32"
     ExtendClientAreaToDecorationsHint="True"
     Icon="/icon.ico"
+    TransparencyLevelHint="AcrylicBlur"
     mc:Ignorable="d">
-    <Border BorderBrush="{StaticResource MainBorderColor}" BorderThickness="1">
-        <DockPanel Background="{StaticResource NoisyTexture}">
-            <views1:WinTitleBar x:Name="TitleBar" DockPanel.Dock="Top" />
-            <views:MainView />
-        </DockPanel>
-    </Border>
+    <Panel>
+        <ExperimentalAcrylicBorder IsHitTestVisible="False">
+            <ExperimentalAcrylicBorder.Material>
+                <ExperimentalAcrylicMaterial
+                    BackgroundSource="Digger"
+                    MaterialOpacity="0.1"
+                    TintColor="Black"
+                    TintOpacity=".9" />
+            </ExperimentalAcrylicBorder.Material>
+        </ExperimentalAcrylicBorder>
+
+        <Border BorderBrush="{StaticResource MainBorderColor}" BorderThickness="1">
+            <DockPanel Background="{StaticResource NoisyTexture}">
+                <views1:WinTitleBar x:Name="TitleBar" DockPanel.Dock="Top" />
+                <views:MainView />
+            </DockPanel>
+        </Border>
+    </Panel>
 </Window>

+ 1 - 0
src/PicView.Avalonia.Win32/Views/MainWindow.axaml.cs

@@ -1,5 +1,6 @@
 using Avalonia.Controls;
 using Avalonia.Input;
+using Avalonia.Media;
 
 namespace PicView.Avalonia.Win32.Views;
 

+ 6 - 1
src/PicView.Avalonia.Win32/Views/WinTitleBar.axaml

@@ -34,7 +34,7 @@
                                 <DrawingGroup ClipGeometry="M0,0 V329.25937 H333.44974 V0 H0 Z">
                                     <DrawingGroup>
                                         <GeometryDrawing Brush="{StaticResource AccentColor}" Geometry="F1 M333.44974,329.25937z M0,0z M329.796,130.208L311.354,177.826 304.172,196.392 286.112,243.011 280.229,258.204C279.6,259.845,277.133,259.397,277.133,257.644L277.133,214.336C277.133,214.143,277.164,213.949,277.236,213.776L289.486,182.156 296.669,163.58 306.194,138.991C306.514,138.176,306.101,137.259,305.265,136.953L278.155,126.723C277.536,126.488,277.123,125.897,277.123,125.245L277.123,109.094C277.123,107.983,278.248,107.219,279.3,107.617L328.888,126.346C311.406,53.8949 245.461,0 166.74,0 121.569,0 80.6197,17.7714 50.5885,46.5785L255.368,46.5785C257.928,46.5785,260.012,48.6267,260.012,51.164L260.012,263.198C260.012,265.725,257.938,267.783,255.368,267.783L40.6298,267.783C38.0705,267.783,35.9858,265.735,35.9858,263.198L35.9858,62.5258C13.4779,90.5891 0,126.05 0,164.63 0,255.555 74.6445,329.259 166.73,329.259 184.625,329.259 201.849,326.447 218.01,321.291L210.972,318.631 203.531,315.819 120.971,284.648 269.971,284.648 269.207,286.594 264.935,297.63C306.452,267.681 333.449,219.279 333.449,164.62 333.47,152.819 332.18,141.315 329.796,130.208L329.796,130.208z" />
-                                        <GeometryDrawing Brush="{StaticResource SecondaryAccentColor}" Geometry="F0 M333.44974,329.25937z M0,0z M62.2502,219.656L73.9737,219.656C80.4857,212.339 86.9666,205.033 93.4579,197.717 95.0265,195.944 96.6261,194.211 98.0709,192.357 98.8862,191.348 99.5054,191.287 100.537,191.99 105.563,195.403 110.63,198.725 115.646,202.19 117.018,203.138 117.689,203.464 118.752,201.629 125.14,190.543 131.725,179.609 138.154,168.543 138.928,167.228 139.403,167.452 140.362,168.135 147.432,173.118 154.532,178.08 161.621,183.053 162.375,183.573 163.149,184.062 163.913,184.582 171.384,169.297 178.784,154.154 186.379,138.625 188.484,142.762 190.425,146.553 192.365,150.343 204.191,173.454 216.018,196.545 227.835,219.656L236.514,219.656C239.083,219.656,241.147,217.597,241.147,215.06L241.147,69.4041C241.147,67.3967 239.847,65.7051 238.031,65.0835 237.556,64.9205 237.05,64.8084 236.524,64.8084L62.2502,64.8084C59.6806,64.8084,57.6166,66.8668,57.6166,69.4041L57.6166,215.06C57.6166,216.15 58.0191,217.149 58.6589,217.933 59.5051,218.973 60.7848,219.656 62.2502,219.656L62.2502,219.656z M105.119,125.969C116.203,126.631 124.583,135.619 124.284,146.654 123.953,159.188 114.16,166.963 103.375,166.739 90.7024,166.474 82.9521,156.773 82.8282,145.992 83.2721,134.039 92.8696,125.245 105.119,125.969L105.119,125.969z" />
+                                        <GeometryDrawing Brush="{StaticResource LogoAccentColor}" Geometry="F0 M333.44974,329.25937z M0,0z M62.2502,219.656L73.9737,219.656C80.4857,212.339 86.9666,205.033 93.4579,197.717 95.0265,195.944 96.6261,194.211 98.0709,192.357 98.8862,191.348 99.5054,191.287 100.537,191.99 105.563,195.403 110.63,198.725 115.646,202.19 117.018,203.138 117.689,203.464 118.752,201.629 125.14,190.543 131.725,179.609 138.154,168.543 138.928,167.228 139.403,167.452 140.362,168.135 147.432,173.118 154.532,178.08 161.621,183.053 162.375,183.573 163.149,184.062 163.913,184.582 171.384,169.297 178.784,154.154 186.379,138.625 188.484,142.762 190.425,146.553 192.365,150.343 204.191,173.454 216.018,196.545 227.835,219.656L236.514,219.656C239.083,219.656,241.147,217.597,241.147,215.06L241.147,69.4041C241.147,67.3967 239.847,65.7051 238.031,65.0835 237.556,64.9205 237.05,64.8084 236.524,64.8084L62.2502,64.8084C59.6806,64.8084,57.6166,66.8668,57.6166,69.4041L57.6166,215.06C57.6166,216.15 58.0191,217.149 58.6589,217.933 59.5051,218.973 60.7848,219.656 62.2502,219.656L62.2502,219.656z M105.119,125.969C116.203,126.631 124.583,135.619 124.284,146.654 123.953,159.188 114.16,166.963 103.375,166.739 90.7024,166.474 82.9521,156.773 82.8282,145.992 83.2721,134.039 92.8696,125.245 105.119,125.969L105.119,125.969z" />
                                     </DrawingGroup>
                                 </DrawingGroup>
                             </DrawingImage.Drawing>
@@ -49,6 +49,7 @@
                 Background="{StaticResource MainButtonBackgroundColor}"
                 BorderBrush="{StaticResource MainBorderColor}"
                 BorderThickness="0,0,1,0"
+                Classes="hover"
                 DockPanel.Dock="Left">
                 <Image Width="17">
                     <DrawingImage>
@@ -80,6 +81,7 @@
                 Background="{StaticResource MainButtonBackgroundColor}"
                 BorderBrush="{StaticResource MainBorderColor}"
                 BorderThickness="0,0,1,0"
+                Classes="hover"
                 DockPanel.Dock="Left">
                 <Path
                     Width="12"
@@ -94,6 +96,7 @@
                 Background="{StaticResource MainButtonBackgroundColor}"
                 BorderBrush="{StaticResource MainBorderColor}"
                 BorderThickness="0,0,1,0"
+                Classes="hover"
                 Command="{Binding ExitCommand}"
                 DockPanel.Dock="Right">
                 <Path
@@ -110,6 +113,7 @@
                 Background="{StaticResource MainButtonBackgroundColor}"
                 BorderBrush="{StaticResource MainBorderColor}"
                 BorderThickness="0,0,1,0"
+                Classes="hover"
                 DockPanel.Dock="Right">
                 <Path
                     Width="12"
@@ -124,6 +128,7 @@
                 Background="{StaticResource MainButtonBackgroundColor}"
                 BorderBrush="{StaticResource MainBorderColor}"
                 BorderThickness="1,0,1,0"
+                Classes="hover"
                 Command="{Binding MinimizeCommand}"
                 DockPanel.Dock="Right">
                 <Viewbox Width="12" Height="12">

+ 8 - 18
src/PicView.Avalonia/PicView.Avalonia.csproj

@@ -14,20 +14,10 @@
 
   
   <ItemGroup>
-    <None Remove="Assets\Fonts\Roboto-Black.ttf" />
-    <None Remove="Assets\Fonts\Roboto-Bold.ttf" />
-    <None Remove="Assets\Fonts\Roboto-Italic.ttf" />
-    <None Remove="Assets\Fonts\Roboto-Light.ttf" />
-    <None Remove="Assets\Fonts\Roboto-LightItalic.ttf" />
-    <None Remove="Assets\Fonts\Roboto-Medium.ttf" />
-    <None Remove="Assets\Fonts\Roboto-MediumItalic.ttf" />
-    <None Remove="Assets\Fonts\Roboto-Regular.ttf" />
-    <None Remove="Assets\Fonts\Roboto-Thin.ttf" />
-    <None Remove="Assets\Fonts\Roboto-ThinItalic.ttf" />
-    <None Remove="Assets\Fonts\texgyreheros-bold.otf" />
-    <None Remove="Assets\Fonts\texgyreheros-italic.otf" />
-    <None Remove="Assets\Fonts\texgyreheros-regular.otf" />
-    <None Remove="Themes\Dark\noisy-texture-200x200-o4-d31-c-161616-t0.png" />
+    <AvaloniaXaml Remove="Themes\**" />
+    <Compile Remove="Themes\**" />
+    <EmbeddedResource Remove="Themes\**" />
+    <None Remove="Themes\**" />
   </ItemGroup>
 
   <ItemGroup>
@@ -37,13 +27,13 @@
     <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />
   </ItemGroup>
 
-  <ItemGroup>
-    <AvaloniaResource Include="Themes\Dark\Resources\noisy-texture-200x200-o4-d31-c-161616-t0.png" />
-  </ItemGroup>
-
   <ItemGroup>
     <Compile Update="Views\TitleTextbox.axaml.cs">
       <DependentUpon>TitleTextBox.axaml</DependentUpon>
     </Compile>
   </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="Assets\" />
+  </ItemGroup>
 </Project>

+ 22 - 18
src/PicView.Avalonia/Views/TitleTextBox.axaml

@@ -1,18 +1,22 @@
-<UserControl 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"
-             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
-             x:Class="PicView.Avalonia.Views.TitleTextBox">
-            <TextBlock
-                Height="30"
-                Padding="3,7,3,5"
-                VerticalAlignment="Center"
-                Background="{StaticResource SecondaryBackgroundColor}"
-                FontSize="13"
-                FontWeight="Medium"
-                IsTabStop="False"
-                Text="Loading...."
-                TextAlignment="Center"
-                TextTrimming="CharacterEllipsis" />
-</UserControl>
+<UserControl
+    x:Class="PicView.Avalonia.Views.TitleTextBox"
+    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"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <TextBlock
+        Height="30"
+        Padding="3,7,3,5"
+        VerticalAlignment="Center"
+        Background="{StaticResource SecondaryBackgroundColor}"
+        FontFamily="avares://PicView.Avalonia.Theme/Assets/Fonts/Roboto-Medium.ttf#Roboto"
+        FontSize="13"
+        FontWeight="Medium"
+        IsTabStop="False"
+        Text="Loading...."
+        TextAlignment="Center"
+        TextTrimming="CharacterEllipsis" />
+</UserControl>

+ 6 - 0
src/PicView.sln

@@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PicView.Windows", "PicView.
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PicView.MacOS", "PicView.MacOS\PicView.MacOS.csproj", "{FEAC727E-1102-4F11-A747-5A5789FBBF81}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PicView.Avalonia.Theme", "PicView.Avalonia.Theme\PicView.Avalonia.Theme.csproj", "{EE8108EE-F9B9-44C3-AEAB-298BC503DF0D}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -57,6 +59,10 @@ Global
 		{FEAC727E-1102-4F11-A747-5A5789FBBF81}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{FEAC727E-1102-4F11-A747-5A5789FBBF81}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{FEAC727E-1102-4F11-A747-5A5789FBBF81}.Release|Any CPU.Build.0 = Release|Any CPU
+		{EE8108EE-F9B9-44C3-AEAB-298BC503DF0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{EE8108EE-F9B9-44C3-AEAB-298BC503DF0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{EE8108EE-F9B9-44C3-AEAB-298BC503DF0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{EE8108EE-F9B9-44C3-AEAB-298BC503DF0D}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE