Ruben 1 год назад
Родитель
Сommit
51e0310f24

+ 3 - 6
src/PicView.Avalonia.Win32/Views/ExifWindow.axaml

@@ -82,7 +82,7 @@
                     Classes="noBorderHover"
                     Command="{Binding OptimizeImageCommand}"
                     Height="28"
-                    Width="130"
+                    Width="133"
                     x:Name="OptimizeButton">
                     <TextBlock
                         Classes="txt"
@@ -120,7 +120,7 @@
                     CommandParameter="{CompiledBinding FileInfo.FullName,
                                                        FallbackValue=''}"
                     Height="28"
-                    Width="131"
+                    Width="133"
                     x:Name="LocateOnDiskButton">
                     <TextBlock
                         Classes="txt"
@@ -130,10 +130,7 @@
                         VerticalAlignment="Center"
                         x:Name="LocateOnDiskText" />
                 </Button>
-                <buttons:StarOutlineButtons
-                    Background="{DynamicResource SecondaryBackgroundColor}"
-                    Padding="5,0,0,3"
-                    x:Name="StarOutlineButtons" />
+                <buttons:StarOutlineButtons Background="{DynamicResource TertiaryBackgroundColor}" x:Name="StarOutlineButtons" />
 
                 <customControls:IconButton
                     Background="{DynamicResource MainButtonBackgroundColor}"

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

@@ -18,6 +18,7 @@ public partial class ExifWindow : Window
             BorderRectangle.Height = 0;
             
             TopWindowBorder.Background = Brushes.Transparent;
+            StarOutlineButtons.Background = Brushes.Transparent;
             
             CloseButton.Background = Brushes.Transparent;
             CloseButton.BorderThickness = new Thickness(0);

+ 1 - 0
src/PicView.Avalonia/ColorManagement/ThemeManager.cs

@@ -69,5 +69,6 @@ public static class ThemeManager
             
         Application.Current.Resources["MenuBackgroundColor"] = Color.Parse("#D73E3E3E");
         Application.Current.Resources["MenuButtonColor"] = Color.Parse("#76909090");
+        
     }
 }

+ 1 - 1
src/PicView.Avalonia/CustomControls/IconButton.cs

@@ -111,7 +111,7 @@ public class IconButton : Button
     /// <returns>A <see cref="Control"/> representing the icon, or <c>null</c> if no icon is set.</returns>
     private Control? BuildIcon()
     {
-        if (Icon is DrawingImage { Drawing: DrawingGroup drawingGroup })
+        if (Icon is { Drawing: DrawingGroup drawingGroup })
         {
             // Set the initial pen brush to match the Foreground color
             foreach (var drawing in drawingGroup.Children)

+ 28 - 2
src/PicView.Avalonia/PicViewTheme/Controls/Button.axaml

@@ -20,11 +20,13 @@
             </ControlTemplate>
         </Setter>
 
+        <!--  Start of animations  -->
+
         <Style Selector="^.hover:pointerover /template/ ContentPresenter#PART_ContentPresenter">
             <Style.Animations>
                 <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
                     <KeyFrame>
-                        <Setter Property="Background">
+                        <Setter Property="Foreground">
                             <SolidColorBrush Color="{DynamicResource MainTextColor}" />
                         </Setter>
                         <Setter Property="Background">
@@ -51,12 +53,33 @@
             <Setter Property="Background" Value="{DynamicResource AccentColor}" />
             <Setter Property="BorderBrush" Value="{DynamicResource AccentColor}" />
         </Style>
+        <Style Selector="^.errorHover:pointerover /template/ ContentPresenter#PART_ContentPresenter">
+            <Style.Animations>
+                <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
+                    <KeyFrame>
+                        <Setter Property="Background">
+                            <SolidColorBrush Color="#992420" />
+                        </Setter>
+                    </KeyFrame>
+                    <KeyFrame Cue="1">
+                        <Setter Property="Foreground">
+                            <SolidColorBrush Color="{StaticResource SecondaryTextColor}" />
+                        </Setter>
+                        <Setter Property="Background">
+                            <SolidColorBrush Color="#992420" />
+                        </Setter>
+                    </KeyFrame>
+                </Animation>
+            </Style.Animations>
+            <Setter Property="Foreground" Value="{StaticResource SecondaryTextColor}" />
+            <Setter Property="Background" Value="#992420" />
+        </Style>
         <Style Selector="^.altHover:pointerover /template/ ContentPresenter#PART_ContentPresenter">
             <Style.Animations>
                 <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
                     <KeyFrame>
                         <Setter Property="Background">
-                            <SolidColorBrush Color="Transparent" />
+                            <SolidColorBrush Color="{DynamicResource SecondaryBackgroundColor}" />
                         </Setter>
                         <Setter Property="BorderBrush">
                             <SolidColorBrush Color="{DynamicResource MainBorderColor}" />
@@ -109,6 +132,9 @@
             </Style.Animations>
             <Setter Property="Foreground" Value="{DynamicResource AccentColor}" />
         </Style>
+
+        <!--  End of animations  -->
+
         <Style Selector="^.hover:pressed  /template/ ContentPresenter#PART_ContentPresenter">
             <Setter Property="Background" Value="{DynamicResource SecondaryAccentColor}" />
         </Style>

+ 4 - 5
src/PicView.Avalonia/PicViewTheme/Controls/SplitButton.axaml

@@ -153,7 +153,7 @@
                     </KeyFrame>
                     <KeyFrame Cue="1">
                         <Setter Property="Background">
-                            <SolidColorBrush Color="{DynamicResource BackgroundHoverColor}" />
+                            <SolidColorBrush Color="{DynamicResource AltBackgroundHoverColor}" />
                         </Setter>
                         <Setter Property="BorderBrush">
                             <SolidColorBrush Color="{DynamicResource SecondaryBorderColor}" />
@@ -161,10 +161,9 @@
                     </KeyFrame>
                 </Animation>
             </Style.Animations>
-            <Setter Property="Background" Value="{DynamicResource BackgroundHoverColor}" />
+            <Setter Property="Background" Value="{DynamicResource AltBackgroundHoverColor}" />
             <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderColor}" />
         </Style>
-
         <Style Selector="^.altHover:pointerover /template/ Button#PART_SecondaryButton">
             <Style.Animations>
                 <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
@@ -178,7 +177,7 @@
                     </KeyFrame>
                     <KeyFrame Cue="1">
                         <Setter Property="Background">
-                            <SolidColorBrush Color="{DynamicResource BackgroundHoverColor}" />
+                            <SolidColorBrush Color="{DynamicResource AltBackgroundHoverColor}" />
                         </Setter>
                         <Setter Property="BorderBrush">
                             <SolidColorBrush Color="{DynamicResource SecondaryBorderColor}" />
@@ -186,7 +185,7 @@
                     </KeyFrame>
                 </Animation>
             </Style.Animations>
-            <Setter Property="Background" Value="{DynamicResource BackgroundHoverColor}" />
+            <Setter Property="Background" Value="{DynamicResource AltBackgroundHoverColor}" />
             <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderColor}" />
         </Style>
 

+ 2 - 6
src/PicView.Avalonia/PicViewTheme/ResourceDictionaries/MainColors.axaml

@@ -32,8 +32,6 @@
 
             <Color x:Key="ButtonForegroundPointerOver">#FFF</Color>
 
-            <Color x:Key="BackgroundAlpha">#442e2e2e</Color>
-
             <Color x:Key="MenuBackgroundColor">#292929</Color>
             <Color x:Key="MenuButtonColor">#2F2F2F</Color>
 
@@ -73,14 +71,14 @@
 
             <Color x:Key="MainBackgroundColor">White</Color>
             <Color x:Key="SecondaryBackgroundColor">#1CFFFFFF</Color>
-            <Color x:Key="TertiaryBackgroundColor">#FAA6A6A6</Color>
+            <Color x:Key="TertiaryBackgroundColor">#E29E9E9E</Color>
 
             <Color x:Key="DisabledBackgroundColor">#DE5B5B5B</Color>
             <Color x:Key="DisabledTextColor">#ACA1A1A1</Color>
 
             <Color x:Key="BackgroundHoverColor">#A2EEEEEE</Color>
 
-            <Color x:Key="AltBackgroundHoverColor">#CDFFFFFF</Color>
+            <Color x:Key="AltBackgroundHoverColor">#1CF0F0F0</Color>
             <Color x:Key="AltBackgroundColor">#A7FFFFFF</Color>
 
             <Color x:Key="MainButtonBackgroundColor">#fff</Color>
@@ -92,8 +90,6 @@
 
             <Color x:Key="ButtonForegroundPointerOver">#FFF</Color>
 
-            <Color x:Key="BackgroundAlpha">#32FFFFFF</Color>
-
             <Color x:Key="MenuBackgroundColor">#ECF8F8F8</Color>
             <Color x:Key="MenuButtonColor">#fff</Color>
 

+ 2 - 2
src/PicView.Avalonia/Views/AppearanceView.axaml

@@ -24,8 +24,8 @@
                                    Mode=OneWay}" />
 
         <ComboBox
-            Background="{DynamicResource TertiaryBackgroundColor}"
-            BorderBrush="{DynamicResource TertiaryBorderColor}"
+            Background="{DynamicResource SecondaryBackgroundColor}"
+            BorderBrush="{DynamicResource MainBorderColor}"
             BorderThickness="1"
             FontFamily="/Assets/Fonts/Roboto-Medium.ttf#Roboto"
             Foreground="{StaticResource SecondaryTextColor}"

+ 1 - 1
src/PicView.Avalonia/Views/GalleryView.axaml

@@ -136,7 +136,7 @@
 
         <customControls:GalleryListBox
             AutoScrollToSelectedItem="False"
-            Background="{DynamicResource BackgroundAlpha}"
+            Background="{DynamicResource SecondaryBackgroundColor}"
             BorderBrush="{DynamicResource TertiaryBorderColor}"
             BorderThickness="0,1,0,0"
             Focusable="False"

+ 4 - 3
src/PicView.Avalonia/Views/SettingsView.axaml

@@ -937,9 +937,9 @@
                     </StackPanel>
                 </TabItem.Header>
                 <Button
-                    Background="{DynamicResource BackgroundAlpha}"
+                    Background="{DynamicResource AltBackgroundHoverColor}"
                     BorderBrush="{DynamicResource SecondaryBorderColor}"
-                    Classes="ButtonBorder altHover"
+                    Classes="ButtonBorder hover"
                     Command="{CompiledBinding ShowKeybindingsWindowCommand}"
                     HorizontalAlignment="Left"
                     Margin="20,40,00,20"
@@ -981,10 +981,11 @@
         </TabControl>
 
 
+        <!--  Reset settings  -->
         <Button
             Background="#27FFFFFF"
             BorderThickness="0,1,1,0"
-            Classes="BorderStyle altHover mainBtn"
+            Classes="BorderStyle errorHover mainBtn"
             Command="{CompiledBinding ResetSettingsCommand}"
             CornerRadius="0,0,0,8"
             HorizontalAlignment="Left"

+ 27 - 21
src/PicView.Avalonia/Views/UC/Buttons/StarOutlineButtons.axaml

@@ -15,74 +15,80 @@
     </Design.DataContext>
 
     <StackPanel Orientation="Horizontal">
-        <Canvas Height="28" Width="30">
+        <Canvas
+            PointerEntered="Star1_OnPointerEntered"
+            PointerExited="Stars_OnPointerExited"
+            Width="30">
             <customControls:IconButton
                 Background="Transparent"
-                Canvas.Left="3"
-                Canvas.Top="5"
+                Canvas.Left="5"
+                Canvas.Top="3"
                 Click="OneStarCLick"
                 Command="{Binding SetExifRating1Command}"
+                Foreground="{DynamicResource MainTextColor}"
                 Icon="{StaticResource StarOutlineDrawingImage}"
                 IconHeight="20"
                 IconWidth="20"
-                PointerEntered="Star1_OnPointerEntered"
-                PointerExited="Stars_OnPointerExited"
                 x:Name="Star1" />
         </Canvas>
-        <Canvas Height="28" Width="30">
+        <Canvas
+            PointerEntered="Star2_OnPointerEntered"
+            PointerExited="Stars_OnPointerExited"
+            Width="30">
             <customControls:IconButton
                 Background="Transparent"
                 Canvas.Left="3"
-                Canvas.Top="5"
+                Canvas.Top="3"
                 Click="TwoStarCLick"
                 Command="{Binding SetExifRating2Command}"
                 Icon="{StaticResource StarOutlineDrawingImage}"
                 IconHeight="20"
                 IconWidth="20"
-                PointerEntered="Star2_OnPointerEntered"
-                PointerExited="Stars_OnPointerExited"
                 x:Name="Star2" />
         </Canvas>
-        <Canvas Height="28" Width="30">
+        <Canvas
+            PointerEntered="Star3_OnPointerEntered"
+            PointerExited="Stars_OnPointerExited"
+            Width="30">
             <customControls:IconButton
                 Background="Transparent"
                 Canvas.Left="3"
-                Canvas.Top="5"
+                Canvas.Top="3"
                 Click="ThreeStarCLick"
                 Command="{Binding SetExifRating3Command}"
                 Icon="{StaticResource StarOutlineDrawingImage}"
                 IconHeight="20"
                 IconWidth="20"
-                PointerEntered="Star3_OnPointerEntered"
-                PointerExited="Stars_OnPointerExited"
                 x:Name="Star3" />
         </Canvas>
-        <Canvas Height="28" Width="30">
+        <Canvas
+            PointerEntered="Star4_OnPointerEntered"
+            PointerExited="Stars_OnPointerExited"
+            Width="30">
             <customControls:IconButton
                 Background="Transparent"
                 Canvas.Left="3"
-                Canvas.Top="5"
+                Canvas.Top="3"
                 Click="FourStarCLick"
                 Command="{Binding SetExifRating4Command}"
                 Icon="{StaticResource StarOutlineDrawingImage}"
                 IconHeight="20"
                 IconWidth="20"
-                PointerEntered="Star4_OnPointerEntered"
-                PointerExited="Stars_OnPointerExited"
                 x:Name="Star4" />
         </Canvas>
-        <Canvas Height="28" Width="30">
+        <Canvas
+            PointerEntered="Star5_OnPointerEntered"
+            PointerExited="Stars_OnPointerExited"
+            Width="30">
             <customControls:IconButton
                 Background="Transparent"
                 Canvas.Left="3"
-                Canvas.Top="5"
+                Canvas.Top="3"
                 Click="FiveStarCLick"
                 Command="{Binding SetExifRating5Command}"
                 Icon="{StaticResource StarOutlineDrawingImage}"
                 IconHeight="20"
                 IconWidth="20"
-                PointerEntered="Star5_OnPointerEntered"
-                PointerExited="Stars_OnPointerExited"
                 x:Name="Star5" />
         </Canvas>
     </StackPanel>

+ 4 - 1
src/PicView.Avalonia/Views/UC/Buttons/StarOutlineButtons.axaml.cs

@@ -157,16 +157,19 @@ public partial class StarOutlineButtons : UserControl
 
     public void OutlineStars()
     {
-        if (!this.TryFindResource("StarOutlineDrawingImage", Application.Current.RequestedThemeVariant, out var resourceValue))
+        if (!this.TryFindResource("StarOutlineDrawingImage", Application.Current.RequestedThemeVariant,
+                out var resourceValue))
         {
             return;
         }
+
         var drawingImage = resourceValue as DrawingImage;
         Star1.Icon = drawingImage;
         Star2.Icon = drawingImage;
         Star3.Icon = drawingImage;
         Star4.Icon = drawingImage;
         Star5.Icon = drawingImage;
+            
     }
 
     private void Star1_OnPointerEntered(object? sender, PointerEventArgs e)

+ 2 - 1
src/PicView.Avalonia/Views/UC/Menus/FileMenu.axaml

@@ -27,7 +27,8 @@
                     BorderThickness="0,0,0,1"
                     CornerRadius="8,8,0,0"
                     Height="47"
-                    Width="315" />
+                    Width="315"
+                    x:Name="TopBorder" />
 
                 <customControls:IconButton
                     Background="Transparent"

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

@@ -1,4 +1,6 @@
+using Avalonia.Media;
 using PicView.Avalonia.CustomControls;
+using PicView.Core.Config;
 
 namespace PicView.Avalonia.Views.UC.Menus;
 
@@ -7,5 +9,15 @@ public partial class FileMenu  : AnimatedMenu
     public FileMenu()
     {
         InitializeComponent();
+        Loaded += (_, _) =>
+        {
+            if (SettingsHelper.Settings.Theme.GlassTheme)
+            {
+            }
+            else if (!SettingsHelper.Settings.Theme.Dark)
+            {
+                TopBorder.Background = Brushes.White;
+            }
+        };
     }
 }

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

@@ -31,7 +31,8 @@
                     BorderThickness="0,0,0,1"
                     CornerRadius="8,8,0,0"
                     Height="47"
-                    Width="315" />
+                    Width="315"
+                    x:Name="TopBorder" />
 
                 <customControls:IconButton
                     Background="Transparent"
@@ -142,7 +143,7 @@
                             </DrawingImage>
                         </Image>
                         <AutoCompleteBox
-                            Background="{DynamicResource BackgroundAlpha}"
+                            Background="{DynamicResource AltBackgroundColor}"
                             BorderBrush="{DynamicResource MainBorderColor}"
                             FontFamily="/Assets/Fonts/Roboto-Regular.ttf#Roboto"
                             Foreground="{DynamicResource MainTextColor}"

+ 7 - 2
src/PicView.Avalonia/Views/UC/Menus/ImageMenu.axaml.cs

@@ -1,5 +1,6 @@
 using System.Reactive.Linq;
 using Avalonia.Input;
+using Avalonia.Media;
 using PicView.Avalonia.CustomControls;
 using PicView.Avalonia.Navigation;
 using PicView.Avalonia.ViewModels;
@@ -15,9 +16,13 @@ public partial class ImageMenu  : AnimatedMenu
         InitializeComponent();
         Loaded += delegate
         {
-            if (SettingsHelper.Settings.Theme.GlassTheme || !SettingsHelper.Settings.Theme.Dark)
+            if (SettingsHelper.Settings.Theme.GlassTheme)
             {
-                // TODO fix when not using dark theme
+               GoToPicBox.Background = new SolidColorBrush(Color.Parse("#2CFFFFFF"));
+            }
+            else if (!SettingsHelper.Settings.Theme.Dark)
+            {
+                TopBorder.Background = Brushes.White;
             }
             GoToPicBox.KeyDown += async (_, e) => await GoToPicBox_OnKeyDown(e);
             this.WhenAnyValue(x => x.IsVisible)

+ 4 - 3
src/PicView.Avalonia/Views/UC/Menus/SettingsMenu.axaml

@@ -28,13 +28,14 @@
                     BorderThickness="0,0,0,1"
                     CornerRadius="8,8,0,0"
                     Height="47"
-                    Width="359" />
+                    Width="359"
+                    x:Name="TopBorder" />
 
                 <Button
                     Background="Transparent"
                     BorderBrush="{DynamicResource MainBorderColor}"
                     BorderThickness="0,0,1,0"
-                    Classes="altHover"
+                    Classes="noBorderHover"
                     Command="{Binding ShowSettingsWindowCommand}"
                     CornerRadius="8,0,0,0"
                     Height="46"
@@ -66,7 +67,7 @@
                     BorderBrush="{DynamicResource MainBorderColor}"
                     BorderThickness="0,0,1,0"
                     Canvas.Left="179"
-                    Classes="altHover"
+                    Classes="noBorderHover"
                     Command="{CompiledBinding ShowAboutWindowCommand}"
                     Height="46"
                     ToolTip.Tip="{CompiledBinding AboutWindow,

+ 13 - 0
src/PicView.Avalonia/Views/UC/Menus/SettingsMenu.axaml.cs

@@ -1,4 +1,6 @@
+using Avalonia.Media;
 using PicView.Avalonia.CustomControls;
+using PicView.Core.Config;
 
 namespace PicView.Avalonia.Views.UC.Menus;
 
@@ -7,5 +9,16 @@ public partial class SettingsMenu : AnimatedMenu
     public SettingsMenu()
     {
         InitializeComponent();
+        Loaded += (_, _) =>
+        {
+            if (SettingsHelper.Settings.Theme.GlassTheme)
+            {
+            }
+            else if (!SettingsHelper.Settings.Theme.Dark)
+            {
+                TopBorder.Background = Brushes.White;
+            }
+        };
+
     }
 }

+ 2 - 1
src/PicView.Avalonia/Views/UC/Menus/ToolsMenu.axaml

@@ -28,7 +28,8 @@
                     BorderThickness="0,0,0,1"
                     CornerRadius="8,8,0,0"
                     Height="47"
-                    Width="359" />
+                    Width="359"
+                    x:Name="TopBorder" />
 
                 <Button
                     Background="Transparent"

+ 12 - 0
src/PicView.Avalonia/Views/UC/Menus/ToolsMenu.axaml.cs

@@ -1,4 +1,6 @@
+using Avalonia.Media;
 using PicView.Avalonia.CustomControls;
+using PicView.Core.Config;
 
 namespace PicView.Avalonia.Views.UC.Menus;
 
@@ -7,5 +9,15 @@ public partial class ToolsMenu : AnimatedMenu
     public ToolsMenu()
     {
         InitializeComponent();
+        Loaded += (_, _) =>
+        {
+            if (SettingsHelper.Settings.Theme.GlassTheme)
+            {
+            }
+            else if (!SettingsHelper.Settings.Theme.Dark)
+            {
+                TopBorder.Background = Brushes.White;
+            }
+        };
     }
 }