浏览代码

Theme improvements and fixes for Glass theme

Ruben 8 月之前
父节点
当前提交
b689622709

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

@@ -57,7 +57,13 @@ public static class ThemeManager
 
         Application.Current.Resources["MainTextColor"] = mainColor;
         
-        Application.Current.Resources["MainButtonBackgroundColor"] = Color.Parse("#E5F1F1F1");
+        Application.Current.Resources["MainButtonBackgroundColor"] = Color.Parse("#4D000000");
+        Application.Current.Resources["MainBackgroundColor"] = Color.Parse("#4D000000");
+        
+        Application.Current.Resources["SecondaryButtonBackgroundColor"] = Color.Parse("#D1464646");
+        Application.Current.Resources["SecondaryBackgroundColor"] = Color.Parse("#DE5B5B5B");
+        
+        Application.Current.Resources["DisabledBackgroundColor"] = Color.Parse("#4D5B5B5B");
 
         Application.Current.Resources["MainBorderColor"] = Colors.Transparent;
         Application.Current.Resources["SecondaryBorderColor"] = Colors.Transparent;

+ 1 - 1
src/PicView.Avalonia/PicViewTheme/Classes.axaml

@@ -62,7 +62,7 @@
 
     <Style Selector="TextBox.TStyle">
         <Setter Property="FontSize" Value="12" />
-        <Setter Property="Foreground" Value="{DynamicResource MainTextColorFaded}" />
+        <Setter Property="Foreground" Value="{DynamicResource SecondaryTextColor}" />
         <Setter Property="FontFamily" Value="/Assets/Fonts/Roboto-Medium.ttf#Roboto" />
         <Setter Property="Background" Value="{DynamicResource SecondaryBackgroundColor}" />
         <Setter Property="BorderBrush" Value="{DynamicResource MainBorderColor}" />

+ 4 - 0
src/PicView.Avalonia/PicViewTheme/Controls/TextBox.axaml

@@ -94,5 +94,9 @@
         <Style Selector="^:disabled /template/ Border#border">
             <Setter Property="Background" Value="{StaticResource DisabledBackgroundColor}" />
         </Style>
+
+        <Style Selector="^.txtShadow /template/ TextPresenter#PART_TextPresenter">
+            <Setter Property="Effect" Value="{StaticResource TextShadow}" />
+        </Style>
     </ControlTheme>
 </ResourceDictionary>

+ 1 - 0
src/PicView.Avalonia/PicViewTheme/ResourceDictionaries/MainColors.axaml

@@ -61,6 +61,7 @@
 
             <DropShadowDirectionEffect
                 BlurRadius="1"
+                Color="#E6000000"
                 Direction="360"
                 x:Key="TextShadow" />
         </ResourceDictionary>

+ 2 - 1
src/PicView.Avalonia/Views/BatchResizeView.axaml

@@ -909,7 +909,8 @@
             BorderThickness="1"
             CornerRadius="4"
             Effect="{StaticResource MenuShadowButtonBorder}"
-            Margin="5,10">
+            Margin="5,10"
+            x:Name="BatchLogBorder">
             <customControls:AutoScrollViewer
                 Height="200"
                 Padding="12,7"

+ 17 - 1
src/PicView.Avalonia/Views/BatchResizeView.axaml.cs

@@ -2,6 +2,7 @@
 using Avalonia.Controls;
 using Avalonia.Controls.Documents;
 using Avalonia.Media;
+using Avalonia.Styling;
 using Avalonia.Threading;
 using ImageMagick;
 using PicView.Avalonia.FileSystem;
@@ -32,6 +33,21 @@ public partial class BatchResizeView : UserControl
                 return;
             }
 
+            if (Settings.Theme.GlassTheme)
+            {
+                if (!Application.Current.TryGetResource("DisabledBackgroundColor",
+                        ThemeVariant.Dark, out var cc))
+                {
+                    return;
+                }
+                if (cc is not Color bgColor)
+                {
+                    return;
+                }
+                var background = new SolidColorBrush(bgColor);
+                BatchLogBorder.Background = background;
+            }
+
             SourceFolderTextBox.TextChanged += delegate { CheckIfValidDirectory(SourceFolderTextBox.Text); };
             SourceFolderTextBox.TextChanged += delegate
             {
@@ -494,7 +510,7 @@ public partial class BatchResizeView : UserControl
     {
         var textBlock = new TextBlock
         {
-            Classes = { "txt" },
+            Classes = { "txt", "txtShadow" },
             Padding = new Thickness(0, 0, 0, 5),
             MaxWidth = 580
         };

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

@@ -457,7 +457,7 @@
                                                Mode=OneWay}"
                         TextAlignment="Center" />
                     <ComboBox
-                        Background="{DynamicResource TertiaryBackgroundColor}"
+                        Background="{DynamicResource SecondaryBackgroundColor}"
                         BorderBrush="{DynamicResource MainBorderColor}"
                         BorderThickness="1"
                         CornerRadius="2"