Преглед изворни кода

Disabled gradients in palettes

Krzysztof Krysiński пре 6 месеци
родитељ
комит
e34fac0f5e

+ 1 - 0
src/PixiEditor/Views/Dock/ColorPickerDockView.axaml

@@ -21,6 +21,7 @@
         SecondaryColor="{Binding ColorsSubViewModel.SecondaryColor, Mode=TwoWay, Converter={converters:GenericColorToMediaColorConverter}}"
         ColorState="{Binding ColorsSubViewModel.PrimaryColorState, Mode=TwoWay}"
         EnableGradientsTab="False"
+        EnableRecentBrushes="False"
         UseHintColor="False">
     </input:SmallColorPicker>
 </UserControl>

+ 2 - 0
src/PixiEditor/Views/Input/SmallColorPicker.axaml

@@ -19,6 +19,8 @@
                                                  EnableGradientsTab="{Binding  Path=EnableGradientsTab}"
                                                  GradientState="{Binding  Path=GradientState, Mode=TwoWay}"
                                                  SelectedBrush="{Binding  Path=SelectedBrush, Mode=TwoWay}"
+                                                 EnableRecentColors="{TemplateBinding EnableRecentBrushes}"
+                                                 EnableRecentGradients="{TemplateBinding EnableRecentBrushes}"
                                                  IsVisible="{Binding  Path=Bounds.Height, Converter={converters:ThresholdVisibilityConverter CheckIfLess=False, Threshold=380}}"
                                                  x:Name="mainColorPicker" />
                 <Grid

+ 9 - 0
src/PixiEditor/Views/Input/SmallColorPicker.axaml.cs

@@ -15,6 +15,15 @@ internal partial class SmallColorPicker : DualPickerControlBase, IGradientStorag
     public static readonly StyledProperty<bool> EnableGradientsTabProperty = AvaloniaProperty.Register<SmallColorPicker, bool>(
         nameof(EnableGradientsTab));
 
+    public static readonly StyledProperty<bool> EnableRecentBrushesProperty = AvaloniaProperty.Register<SmallColorPicker, bool>(
+        nameof(EnableRecentBrushes), true);
+
+    public bool EnableRecentBrushes
+    {
+        get => GetValue(EnableRecentBrushesProperty);
+        set => SetValue(EnableRecentBrushesProperty, value);
+    }
+
     public bool EnableGradientsTab
     {
         get => GetValue(EnableGradientsTabProperty);

+ 1 - 0
src/PixiEditor/Views/Palettes/PaletteColorAdder.axaml

@@ -11,6 +11,7 @@
     <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="5">
         <colorPicker:PortableColorPicker
             ColorChanged="PortableColorPicker_ColorChanged"
+            EnableGradientsTab="False"
             SelectedColor="{Binding SelectedColor, ElementName=paletteColorAdder, Mode=TwoWay}"
             UseHintColor="True" HintColor="{Binding ElementName=paletteColorAdder, Path=HintColor}"
             Width="50" Focusable="False"

+ 1 - 1
src/colorpicker

@@ -1 +1 @@
-Subproject commit 8d2e58d6c79a96b9016903999fb69b19472b7d8b
+Subproject commit 1503a4a1ec5baf05500ef687bc2c3030beee7418