瀏覽代碼

new icons and styling

flabbet 1 年之前
父節點
當前提交
2110f659b1

+ 28 - 12
src/PixiEditor.AvaloniaUI/Styles/PortingWipStyles.axaml

@@ -30,12 +30,12 @@
     </Style>
 
     <Style Selector="CheckBox.ImageCheckBox">
-        <Setter Property="Content" Value="{DynamicResource icon-eye-off}"/>
+        <Setter Property="Content" Value="{DynamicResource icon-eye-off}" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate>
                     <Border Cursor="Hand" Background="{TemplateBinding Background}">
-                        <TextBlock Text="{TemplateBinding Content}" FontSize="16" Classes="pixi-icon"/>
+                        <TextBlock Text="{TemplateBinding Content}" FontSize="16" Classes="pixi-icon" />
                     </Border>
                 </ControlTemplate>
             </Setter.Value>
@@ -43,9 +43,25 @@
     </Style>
 
     <Style Selector="CheckBox.ImageCheckBox:checked">
-        <Setter Property="Content" Value="{DynamicResource icon-eye}"/>
+        <Setter Property="Content" Value="{DynamicResource icon-eye}" />
+    </Style>
+    
+    <Style Selector="ToggleButton.PlayButton">
+        <Setter Property="Content" Value="{DynamicResource icon-play}" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Border Cursor="Hand" Background="{TemplateBinding Background}">
+                        <TextBlock Text="{TemplateBinding Content}" FontSize="{TemplateBinding Width}" Classes="pixi-icon" />
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
     </Style>
 
+    <Style Selector="ToggleButton.PlayButton:checked">
+        <Setter Property="Content" Value="{DynamicResource icon-pause}" />
+    </Style>
     <Style Selector="ToggleButton.ExpandCollapseToggleStyle">
 
     </Style>
@@ -94,7 +110,7 @@
                             BorderBrush="{TemplateBinding BorderBrush}"
                             BorderThickness="{TemplateBinding BorderThickness}">
                         <Border.Background>
-                            <ImageBrush Source="/Images/AnchorDot.png"/>
+                            <ImageBrush Source="/Images/AnchorDot.png" />
                         </Border.Background>
                         <Border.Transitions>
                             <Transitions>
@@ -117,17 +133,17 @@
     <Style Selector="ToggleButton.AnchorPointToggleButtonStyle:checked">
         <Setter Property="BorderBrush" Value="{DynamicResource ThemeHighlightForegroundBrush}" />
     </Style>
-    
+
     <Style Selector="Border.KeyBorder">
-        <Setter Property="BorderThickness" Value="1"/>
-        <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
-        <Setter Property="Background" Value="{DynamicResource ThemeControlMidBrush}"/>
-        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}"/>
-        <Setter Property="Padding" Value="7, 0"/>
-        <Setter Property="Margin" Value="0,3,5,3"/>
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
+        <Setter Property="Background" Value="{DynamicResource ThemeControlMidBrush}" />
+        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
+        <Setter Property="Padding" Value="7, 0" />
+        <Setter Property="Margin" Value="0,3,5,3" />
     </Style>
 
     <Style Selector="Border.KeyBorderLast">
-        <Setter Property="Margin" Value="0, 3"/>
+        <Setter Property="Margin" Value="0, 3" />
     </Style>
 </Styles>

+ 1 - 1
src/PixiEditor.AvaloniaUI/Styles/Templates/Timeline.axaml

@@ -36,7 +36,7 @@
                         <input:NumberInput Min="1"
                                            Value="{Binding Fps, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
                         <Panel>
-                            <ToggleButton HorizontalAlignment="Center" Content="Play" Name="PART_PlayToggle" />
+                            <ToggleButton Margin="0, 5" Width="24" HorizontalAlignment="Center" Classes="PlayButton" Name="PART_PlayToggle" />
                         </Panel>
                     </DockPanel>
 

+ 2 - 0
src/PixiEditor.AvaloniaUI/ViewModels/Dock/TimelineDockViewModel.cs

@@ -1,5 +1,6 @@
 using PixiEditor.AvaloniaUI.ViewModels.Document;
 using PixiEditor.Extensions.Common.Localization;
+using PixiEditor.UI.Common.Fonts;
 
 namespace PixiEditor.AvaloniaUI.ViewModels.Dock;
 
@@ -23,5 +24,6 @@ internal class TimelineDockViewModel : DockableViewModel
     public TimelineDockViewModel(DocumentManagerViewModel documentManagerViewModel)
     {
         DocumentManagerSubViewModel = documentManagerViewModel;
+        TabCustomizationSettings.Icon = PixiPerfectIcons.ToIcon(PixiPerfectIcons.Timeline);
     }
 }

+ 3 - 0
src/PixiEditor.DrawingApi.Skia/Implementations/SkiaShaderImplementation.cs

@@ -60,6 +60,9 @@ namespace PixiEditor.DrawingApi.Skia.Implementations
         
         public Shader CreatePerlinFractalNoise(float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed)
         {
+            if(baseFrequencyX <= 0 || baseFrequencyY <= 0)
+                throw new ArgumentException("Base frequency must be greater than 0");
+            
             SKShader shader = SKShader.CreatePerlinNoiseFractalNoise(
                 baseFrequencyX,
                 baseFrequencyY,

+ 4 - 0
src/PixiEditor.UI.Common/Fonts/PixiPerfectIcons.axaml

@@ -124,6 +124,10 @@
             <system:String x:Key="icon-youtube">&#xE975;</system:String>
             <system:String x:Key="icon-misc">&#xE968;</system:String>
             <system:String x:Key="icon-write">&#xE970;</system:String>
+            <system:String x:Key="icon-play">&#xE981;</system:String>
+            <system:String x:Key="icon-pause">&#xE980;</system:String>
+            <system:String x:Key="icon-timeline">&#xE983;</system:String>
+            <system:String x:Key="icon-swatches">&#xE982;</system:String>
         </ResourceDictionary>
     </Styles.Resources>
     

+ 5 - 2
src/PixiEditor.UI.Common/Fonts/PixiPerfectIcons.axaml.cs

@@ -59,7 +59,6 @@ public static class PixiPerfectIcons
     public const string FolderPlus = "\ue92c";
     public const string Folder = "\ue92d";
     public const string Globe = "\ue92e";
-    public const string Swatches = "\ue92f";
     public const string Grid = "\uE941";
     public const string Home = "\ue930";
     public const string RotateImageMinus90 = "\ue931";
@@ -119,7 +118,11 @@ public static class PixiPerfectIcons
     public const string YouTube = "\uE975";
     public const string Write = "\uE968";
     public const string Misc = "\uE970";
-    
+    public const string Play = "\uE981";
+    public const string Pause = "\uE980";
+    public const string Swatches = "\uE982";
+    public const string Timeline = "\uE983";
+        
     public const string Reset = "R"; // TODO: Create a reset icon
     public const string ToggleLayerVisible = "\u25a1;"; // TODO: Create a toggle layer visible icon
     public const string ToggleMask = "\u25a1;"; // TODO: Create a toggle mask icon

二進制
src/PixiEditor.UI.Common/Fonts/pixiperfect.ttf