Browse Source

Avalonia updates

Ruben 1 year ago
parent
commit
59cbe040f6

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

@@ -14,6 +14,7 @@
 
   <ItemGroup>
     <PackageReference Include="Avalonia.Desktop" Version="11.0.7" />
+    <PackageReference Include="Avalonia.Themes.Simple" Version="11.0.7" />
   </ItemGroup>
 
   <ItemGroup>

+ 184 - 0
src/PicView.Avalonia.Theme/Controls/Scrollbar.axaml

@@ -0,0 +1,184 @@
+<ResourceDictionary
+    xmlns="https://github.com/avaloniaui"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    x:ClassModifier="internal">
+    <ControlTheme x:Key="{x:Type ScrollBar}" TargetType="ScrollBar">
+        <Setter Property="Cursor" Value="Arrow" />
+
+        <Style Selector="^:horizontal">
+            <Setter Property="Height" Value="{DynamicResource ScrollBarThickness}" />
+            <Setter Property="Template">
+                <ControlTemplate>
+                    <Border Background="{StaticResource SecondaryBackgroundColor}" UseLayoutRounding="False">
+                        <Grid ColumnDefinitions="Auto,*,Auto">
+                            <RepeatButton
+                                Name="PART_LineUpButton"
+                                Grid.Row="0"
+                                Grid.Column="0"
+                                MinWidth="{DynamicResource ScrollBarThickness}"
+                                VerticalAlignment="Center"
+                                Classes="repeat"
+                                Focusable="False">
+                                <Path Data="M 4 0 L 4 8 L 0 4 Z" />
+                            </RepeatButton>
+                            <Track
+                                Grid.Row="1"
+                                Grid.Column="1"
+                                DeferThumbDrag="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
+                                Maximum="{TemplateBinding Maximum}"
+                                Minimum="{TemplateBinding Minimum}"
+                                Orientation="{TemplateBinding Orientation}"
+                                ViewportSize="{TemplateBinding ViewportSize}"
+                                Value="{TemplateBinding Value,
+                                                        Mode=TwoWay}">
+                                <Track.DecreaseButton>
+                                    <RepeatButton
+                                        Name="PART_PageUpButton"
+                                        Classes="repeattrack"
+                                        Focusable="False" />
+                                </Track.DecreaseButton>
+                                <Track.IncreaseButton>
+                                    <RepeatButton
+                                        Name="PART_PageDownButton"
+                                        Classes="repeattrack"
+                                        Focusable="False" />
+                                </Track.IncreaseButton>
+                                <Thumb Name="thumb" />
+                            </Track>
+                            <RepeatButton
+                                Name="PART_LineDownButton"
+                                Grid.Row="2"
+                                Grid.Column="2"
+                                MinWidth="{DynamicResource ScrollBarThickness}"
+                                VerticalAlignment="Center"
+                                Classes="repeat"
+                                Focusable="False">
+                                <Path Data="M 0 0 L 4 4 L 0 8 Z" />
+                            </RepeatButton>
+                        </Grid>
+                    </Border>
+                </ControlTemplate>
+            </Setter>
+        </Style>
+
+        <Style Selector="^:vertical">
+            <Setter Property="Width" Value="30" />
+            <Setter Property="Template">
+                <ControlTemplate>
+                    <Border Background="{StaticResource SecondaryBackgroundColor}" UseLayoutRounding="False">
+                        <Grid RowDefinitions="Auto,*,Auto">
+                            <RepeatButton
+                                Name="PART_LineUpButton"
+                                Grid.Row="0"
+                                MinHeight="{DynamicResource ScrollBarThickness}"
+                                HorizontalAlignment="Center"
+                                Background="{StaticResource SecondaryBackgroundColor}"
+                                Classes="repeat"
+                                Focusable="False">
+                                <Path
+                                    Width="16"
+                                    Height="16"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Data="F1 M512,512z M0,0z M414,321.94L274.22,158.82A24,24,0,0,0,237.78,158.82L98,321.94C84.66,337.51,95.72,361.56,116.22,361.56L395.82,361.56C416.32,361.56,427.38,337.51,414,321.94z"
+                                    Fill="{StaticResource MainIconColor}"
+                                    Stretch="Fill" />
+                            </RepeatButton>
+                            <Track
+                                Grid.Row="1"
+                                Grid.Column="1"
+                                DeferThumbDrag="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
+                                IsDirectionReversed="True"
+                                Maximum="{TemplateBinding Maximum}"
+                                Minimum="{TemplateBinding Minimum}"
+                                Orientation="{TemplateBinding Orientation}"
+                                ViewportSize="{TemplateBinding ViewportSize}"
+                                Value="{TemplateBinding Value,
+                                                        Mode=TwoWay}">
+                                <Track.DecreaseButton>
+                                    <RepeatButton
+                                        Name="PART_PageUpButton"
+                                        Background="{StaticResource SecondaryBackgroundColor}"
+                                        Classes="repeattrack"
+                                        Focusable="False" />
+                                </Track.DecreaseButton>
+                                <Track.IncreaseButton>
+                                    <RepeatButton
+                                        Name="PART_PageDownButton"
+                                        Background="{StaticResource SecondaryBackgroundColor}"
+                                        Classes="repeattrack"
+                                        Focusable="False" />
+                                </Track.IncreaseButton>
+                                <Thumb Name="thumb" />
+                            </Track>
+                            <RepeatButton
+                                Name="PART_LineDownButton"
+                                Grid.Row="2"
+                                Grid.Column="2"
+                                MinHeight="{DynamicResource ScrollBarThickness}"
+                                HorizontalAlignment="Center"
+                                Background="{StaticResource SecondaryBackgroundColor}"
+                                Classes="repeat"
+                                Focusable="False">
+                                <Path
+                                    Width="16"
+                                    Height="16"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Data="F1 M512,512z M0,0z M98,190.06L237.78,353.18A24,24,0,0,0,274.22,353.18L414,190.06C427.34,174.49,416.28,150.44,395.78,150.44L116.18,150.44C95.6799999999999,150.44,84.6199999999999,174.49,97.9999999999999,190.06z"
+                                    Fill="{StaticResource MainIconColor}"
+                                    Stretch="Fill" />
+                            </RepeatButton>
+                        </Grid>
+                    </Border>
+                </ControlTemplate>
+            </Setter>
+        </Style>
+        <Style Selector="^ /template/ Thumb#thumb">
+            <Setter Property="Background" Value="{StaticResource SecondaryBackgroundColor}" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate>
+                        <Border
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{StaticResource MainBorderColor}"
+                            BorderThickness="1" />
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <Style Selector="^ /template/ Thumb#thumb:pointerover">
+            <Setter Property="Background" Value="{DynamicResource AccentColor}" />
+        </Style>
+        <Style Selector="^ /template/ Thumb#thumb:pressed">
+            <Setter Property="Background" Value="{DynamicResource SecondaryAccentColor}" />
+        </Style>
+        <Style Selector="^:horizontal /template/ Thumb#thumb">
+            <Setter Property="MinWidth" Value="{DynamicResource ScrollBarThickness}" />
+            <Setter Property="Height" Value="{DynamicResource ScrollBarThumbThickness}" />
+        </Style>
+        <Style Selector="^:vertical /template/ Thumb#thumb">
+            <Setter Property="MinHeight" Value="{DynamicResource ScrollBarThickness}" />
+            <Setter Property="Width" Value="16" />
+        </Style>
+        <Style Selector="^ /template/ RepeatButton.repeat">
+            <Setter Property="Padding" Value="2" />
+            <Setter Property="BorderThickness" Value="0" />
+        </Style>
+        <Style Selector="^ /template/ RepeatButton.repeattrack">
+            <Setter Property="Template">
+                <ControlTemplate>
+                    <Border Background="{TemplateBinding Background}" />
+                </ControlTemplate>
+            </Setter>
+        </Style>
+
+        <Style Selector="^ /template/ RepeatButton > Path">
+            <Setter Property="Fill" Value="{StaticResource MainIconColor}" />
+        </Style>
+
+        <Style Selector="^ /template/ RepeatButton:pointerover > Path">
+            <Setter Property="Fill" Value="{DynamicResource AccentColor}" />
+        </Style>
+    </ControlTheme>
+</ResourceDictionary>

+ 26 - 0
src/PicView.Avalonia.Theme/Controls/ToolTip.axaml

@@ -0,0 +1,26 @@
+<ResourceDictionary
+    xmlns="https://github.com/avaloniaui"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    x:ClassModifier="internal">
+    <ControlTheme x:Key="{x:Type ToolTip}" TargetType="ToolTip">
+        <Setter Property="Background" Value="{DynamicResource SecondaryBackgroundColor}" />
+        <Setter Property="BorderBrush" Value="{StaticResource MainBorderColor}" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="FontSize" Value="11" />
+        <Setter Property="FontFamily" Value="/Assets/Fonts/Roboto-Regular.ttf#Roboto" />
+        <Setter Property="Foreground" Value="{StaticResource MainTextColor}" />
+        <Setter Property="Template">
+            <ControlTemplate>
+                <ContentPresenter
+                    Name="PART_ContentPresenter"
+                    Padding="7"
+                    Background="{TemplateBinding Background}"
+                    BorderBrush="{TemplateBinding BorderBrush}"
+                    BorderThickness="{TemplateBinding BorderThickness}"
+                    Content="{TemplateBinding Content}"
+                    ContentTemplate="{TemplateBinding ContentTemplate}"
+                    CornerRadius="5" />
+            </ControlTemplate>
+        </Setter>
+    </ControlTheme>
+</ResourceDictionary>

+ 2 - 1
src/PicView.Avalonia.Theme/Dark/DarkTheme.axaml

@@ -35,6 +35,8 @@
                 <ResourceInclude Source="/Controls/Border.axaml" />
                 <ResourceInclude Source="/Controls/TextBlock.axaml" />
                 <ResourceInclude Source="/Controls/PathIcon.axaml" />
+                <ResourceInclude Source="/Controls/ScrollBar.axaml" />
+                <ResourceInclude Source="/Controls/ToolTip.axaml" />
                 <ResourceInclude Source="/Controls/Window.axaml" />
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
@@ -61,5 +63,4 @@
             <Setter Property="Background" Value="{DynamicResource AccentColor}" />
         </Style>
     </Style>
-
 </Styles>

+ 7 - 1
src/PicView.Avalonia.Theme/PicView.Avalonia.Theme.csproj

@@ -1,12 +1,18 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <Nullable>enable</Nullable>
     <LangVersion>latest</LangVersion>
     <ImplicitUsings>enable</ImplicitUsings>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <DebugType>none</DebugType>
+    <IsTrimmable>True</IsTrimmable>
+    <IsAotCompatible>True</IsAotCompatible>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <IsTrimmable>True</IsTrimmable>
+    <IsAotCompatible>True</IsAotCompatible>
   </PropertyGroup>
 
   

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

@@ -8,6 +8,15 @@
     <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
     <ApplicationManifest>app.manifest</ApplicationManifest>
     <ApplicationIcon>icon.ico</ApplicationIcon>
+    <PublishAot>True</PublishAot>
+    <Trimming>full</Trimming>
+    <PlatformTarget>x64</PlatformTarget>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Product>PicView</Product>
+    <Company>Ruben Hyldgaard Negendahl</Company>
+    <Authors>Ruben Hyldgaard Negendahl</Authors>
+    <Copyright>© Ruben Hyldgaard Negendahl</Copyright>
+    <AssemblyName>PicView</AssemblyName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <DebugType>none</DebugType>
@@ -20,6 +29,7 @@
 
   <ItemGroup>
     <PackageReference Include="Avalonia.Desktop" Version="11.0.7" />
+    <PackageReference Include="Avalonia.Themes.Simple" Version="11.0.7" />
   </ItemGroup>
 
   <ItemGroup>

+ 2 - 0
src/PicView.Avalonia/Helpers/WindowHelper.cs

@@ -24,5 +24,7 @@ public static class WindowHelper
         SettingsHelper.Settings.WindowProperties.Left = desktop.MainWindow.Position.Y;
         SettingsHelper.Settings.WindowProperties.Width = desktop.MainWindow.Width;
         SettingsHelper.Settings.WindowProperties.Height = desktop.MainWindow.Height;
+
+        _ = SettingsHelper.SaveSettingsAsync();
     }
 }

+ 33 - 12
src/PicView.Avalonia/Navigation/ImageIterator.cs

@@ -1,9 +1,8 @@
-using Avalonia.Media;
+using PicView.Avalonia.Models;
 using PicView.Core.Config;
 using PicView.Core.FileHandling;
 using PicView.Core.Navigation;
 using System.Diagnostics;
-using PicView.Avalonia.Models;
 
 namespace PicView.Avalonia.Navigation
 {
@@ -21,28 +20,49 @@ namespace PicView.Avalonia.Navigation
             if (next < 0)
                 throw new InvalidOperationException("Invalid iteration");
             Index = next;
+            var x = 0;
 
             var preLoadValue = PreLoader.Get(next, Pics);
             if (preLoadValue is null)
             {
-                await PreLoader.AddAsync(next, Pics).ConfigureAwait(false);
-                preLoadValue = PreLoader.Get(next, Pics);
+                await GetPreload();
+            }
+
+            while (preLoadValue.IsLoading)
+            {
+                x++;
+                await Task.Delay(20);
                 if (Index != next)
                 {
                     throw new TaskCanceledException();
                 }
+
+                if (x > 100)
+                {
+                    await GetPreload();
+#if DEBUG
+                    Trace.WriteLine("Loading timeout");
+#endif
+                    break;
+                }
             }
 
-            while (preLoadValue.IsLoading)
+            return preLoadValue.ImageModel;
+
+            async Task GetPreload()
             {
-                await Task.Delay(20).ConfigureAwait(false);
+                await PreLoader.AddAsync(next, Pics).ConfigureAwait(false);
+                preLoadValue = PreLoader.Get(next, Pics);
                 if (Index != next)
                 {
                     throw new TaskCanceledException();
                 }
-            }
 
-            return preLoadValue.ImageModel;
+                if (preLoadValue is null)
+                {
+                    throw new ArgumentNullException();
+                }
+            }
         }
 
         public async Task Preload()
@@ -50,12 +70,13 @@ namespace PicView.Avalonia.Navigation
             await PreLoader.PreLoadAsync(Index, Pics.Count, true, Reverse, Pics).ConfigureAwait(false);
         }
 
-        private int GetIteration(int index, NavigateTo navigateTo)
+        public async Task AddAsync(int index, ImageModel imageModel)
         {
-#if DEBUG
-            Debug.Assert(Pics != null, nameof(Pics) + " != null");
-#endif
+            await PreLoader.AddAsync(index, Pics, imageModel).ConfigureAwait(false);
+        }
 
+        private int GetIteration(int index, NavigateTo navigateTo)
+        {
             int next;
             var prev = Index;
             switch (navigateTo)

+ 1 - 4
src/PicView.Avalonia/Navigation/PreloaderService.cs

@@ -1,8 +1,5 @@
-using Avalonia.Media.Imaging;
-using ImageMagick;
+using ImageMagick;
 using PicView.Avalonia.Models;
-using PicView.Avalonia.Services;
-using PicView.Core.FileHandling;
 using PicView.Core.ImageDecoding;
 using System.Collections.Concurrent;
 using System.Diagnostics;

+ 2 - 13
src/PicView.Avalonia/Services/ImageService.cs

@@ -1,16 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Avalonia.Media;
-using PicView.Avalonia.Models;
-using PicView.Core.FileHandling;
-using static PicView.Core.FileHandling.FileListHelper;
+namespace PicView.Avalonia.Services;
 
-namespace PicView.Avalonia.Services
+public class ImageService
 {
-    public class ImageService
-    {
-    }
 }

+ 24 - 4
src/PicView.Avalonia/ViewModels/MainViewModel.cs

@@ -65,6 +65,8 @@ public class MainViewModel : ViewModelBase
 
     #endregion Commands
 
+    #region Fields
+
     private string _title = "Loading...";
 
     public string Title
@@ -169,6 +171,22 @@ public class MainViewModel : ViewModelBase
         set => this.RaiseAndSetIfChanged(ref _zoomValue, value);
     }
 
+    public ImageIterator? ImageIterator;
+
+    public ImageService? ImageService;
+
+    private bool _isFileMenuVisible;
+
+    public bool IsFileMenuVisible
+    {
+        get => _isFileMenuVisible;
+        set => this.RaiseAndSetIfChanged(ref _isFileMenuVisible, value);
+    }
+
+    #endregion Fields
+
+    #region Methods
+
     public void SetImageModel(ImageModel? imageModel)
     {
         ArgumentNullException.ThrowIfNull(imageModel);
@@ -181,6 +199,7 @@ public class MainViewModel : ViewModelBase
         IsAnimated = imageModel.IsAnimated;
         IsFlipped = imageModel.IsFlipped;
         Rotation = imageModel.Rotation;
+        ZoomValue = 1;
     }
 
     public void SetTitle(ImageModel? imageModel, ImageIterator imageIterator)
@@ -222,12 +241,11 @@ public class MainViewModel : ViewModelBase
         ImageIterator = new ImageIterator(imageModel.FileInfo);
         ImageIterator.Index = ImageIterator.Pics.IndexOf(path);
         SetTitle(imageModel, ImageIterator);
+        await ImageIterator.AddAsync(ImageIterator.Index, imageModel);
         await ImageIterator.Preload();
     }
 
-    public ImageIterator? ImageIterator;
-
-    public ImageService? ImageService;
+    #endregion Methods
 
     public MainViewModel()
     {
@@ -236,6 +254,8 @@ public class MainViewModel : ViewModelBase
             return;
         }
 
+        WindowHelper.InitializeWindowSizeAndPosition(desktop);
+
         var args = Environment.GetCommandLineArgs();
         if (args.Length > 1)
         {
@@ -252,7 +272,7 @@ public class MainViewModel : ViewModelBase
             CurrentView = new StartUpMenu();
         }
 
-        WindowHelper.InitializeWindowSizeAndPosition(desktop);
+        IsFileMenuVisible = true;
 
         ExitCommand = ReactiveCommand.Create(desktop.MainWindow.Close);
         MinimizeCommand = ReactiveCommand.Create(() =>

+ 3 - 1
src/PicView.Avalonia/Views/MainView.axaml

@@ -16,5 +16,7 @@
         -->
         <vm:MainViewModel />
     </Design.DataContext>
-    <ContentControl Content="{Binding CurrentView}" />
+    <Grid x:Name="MainGrid">
+        <ContentControl Content="{Binding CurrentView}" />
+    </Grid>
 </UserControl>

+ 16 - 1
src/PicView.Avalonia/Views/MainView.axaml.cs

@@ -1,4 +1,6 @@
-using Avalonia.Controls;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Layout;
 
 namespace PicView.Avalonia.Views;
 
@@ -7,5 +9,18 @@ public partial class MainView : UserControl
     public MainView()
     {
         InitializeComponent();
+
+        Loaded += delegate
+        {
+            var fileMenu = new UC.Menus.FileMenu
+            {
+                VerticalAlignment = VerticalAlignment.Bottom,
+                HorizontalAlignment = HorizontalAlignment.Center,
+                Margin = new Thickness(0, 0, 168, 0),
+                Opacity = 1
+            };
+
+            MainGrid.Children.Add(fileMenu);
+        };
     }
 }

+ 3 - 2
src/PicView.Avalonia/Views/UC/BottomBar.axaml

@@ -5,6 +5,7 @@
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:viewModels="clr-namespace:PicView.Avalonia.ViewModels"
+    Height="26"
     d:DesignHeight="450"
     d:DesignWidth="800"
     x:DataType="viewModels:MainViewModel"
@@ -30,8 +31,8 @@
                     BorderThickness="1,0,1,0"
                     Classes="altHover">
                     <Path
-                        Width="20.091"
-                        Height="22"
+                        Width="25.112"
+                        Height="20.091"
                         Data="M30.718,23.404l0.007-19.877c-0.003-0.611-0.499-1.107-1.109-1.107H15.597  c-0.433-0.01-0.771-0.807-0.771-1.111V1.182c0-0.648-0.528-1.182-1.18-1.182h-7.46C5.535,0,5.008,0.533,5.008,1.182v0.127  c0,0.309-0.341,1.117-0.784,1.117h0.013c-0.604,0.008-1.094,0.5-1.094,1.105l0.005,5.754H0.763c0,0-1.056-0.057-0.683,1.199  l2.516,12.92c0,0.65,0.453,1.176,1.104,1.176h26.474C30.824,24.58,30.718,23.404,30.718,23.404z M29.359,10.949l-0.014,12.975  l-2.502-13.908c-0.212-0.764-1.075-0.711-1.075-0.711H4.51V4.891h24.85V10.949z"
                         Fill="{StaticResource MainIconColor}"
                         Stretch="Fill" />

+ 2 - 2
src/PicView.Avalonia/Views/UC/ImageViewer.axaml

@@ -12,7 +12,7 @@
     <Design.DataContext>
         <vm:MainViewModel />
     </Design.DataContext>
-    <Grid>
+    <ScrollViewer>
         <Image Source="{Binding Image}" />
-    </Grid>
+    </ScrollViewer>
 </UserControl>

+ 46 - 0
src/PicView.Avalonia/Views/UC/Menus/FileMenu.axaml

@@ -0,0 +1,46 @@
+<UserControl
+    x:Class="PicView.Avalonia.Views.UC.Menus.FileMenu"
+    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:viewModels="clr-namespace:PicView.Avalonia.ViewModels"
+    x:DataType="viewModels:MainViewModel"
+    IsVisible="{Binding IsFileMenuVisible}"
+    mc:Ignorable="d">
+    <Design.DataContext>
+        <viewModels:MainViewModel />
+    </Design.DataContext>
+    <StackPanel>
+        <Canvas Width="277" Height="185">
+            <Border
+                Width="277"
+                Height="185"
+                Background="{StaticResource MainBackgroundColor}"
+                BorderBrush="{StaticResource MainBorderColor}"
+                BorderThickness="1"
+                CornerRadius="8,8,0,0" />
+
+            <Border
+                Width="277"
+                Height="47"
+                Background="{StaticResource SecondaryBackgroundColor}"
+                BorderBrush="{StaticResource MainBorderColor}"
+                BorderThickness="1"
+                CornerRadius="8,8,0,0" />
+        </Canvas>
+        <Rectangle
+            Width="26"
+            Height="1.5"
+            Margin="38,0,0,0"
+            HorizontalAlignment="Left"
+            Fill="{StaticResource SecondaryBackgroundColor}" />
+        <Polygon
+            Margin="36,-3.5,0,0"
+            Fill="{StaticResource SecondaryBackgroundColor}"
+            Points="0,0 15,30, 30,0"
+            Stroke="{StaticResource MainBorderColor}"
+            StrokeThickness="1"
+            ZIndex="-1" />
+    </StackPanel>
+</UserControl>

+ 11 - 0
src/PicView.Avalonia/Views/UC/Menus/FileMenu.axaml.cs

@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace PicView.Avalonia.Views.UC.Menus;
+
+public partial class FileMenu : UserControl
+{
+    public FileMenu()
+    {
+        InitializeComponent();
+    }
+}

+ 1 - 0
src/PicView.Avalonia/Views/UC/TitleTextBox.axaml

@@ -18,6 +18,7 @@
         Padding="3,7,3,5"
         VerticalAlignment="Center"
         FontFamily="avares://PicView.Avalonia.Theme/Assets/Fonts/Roboto-Medium.ttf#Roboto"
+        FontSize="13"
         FontWeight="Medium"
         IsTabStop="False"
         Text="{Binding Title}"