From 9e1a6253b68c2e117f0585668a5ec635e0e61f3f Mon Sep 17 00:00:00 2001 From: robloo Date: Mon, 27 Jun 2022 00:53:49 -0400 Subject: [PATCH] Only disable alpha editing controls when IsAlphaEnabled is false Rely on IsAlphaVisible for visibility --- .../ColorView/ColorView.Properties.cs | 6 +++--- .../Themes/Fluent/ColorView.xaml | 20 ++++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs b/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs index e1da427542..d59c4d544a 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs @@ -270,7 +270,7 @@ namespace Avalonia.Controls /// /// Gets or sets a value indicating whether the alpha component is enabled. /// When disabled (set to false) the alpha component will be fixed to maximum and - /// editing controls hidden. + /// editing controls disabled. /// public bool IsAlphaEnabled { @@ -357,7 +357,7 @@ namespace Avalonia.Controls /// /// /// All color components are controlled by this property but alpha can also be - /// controlled with and . + /// controlled with . /// public bool IsComponentSliderVisible { @@ -370,7 +370,7 @@ namespace Avalonia.Controls /// /// /// All color components are controlled by this property but alpha can also be - /// controlled with and . + /// controlled with . /// public bool IsComponentTextInputVisible { diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml index d43bc7e004..563f230cc9 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml @@ -187,11 +187,10 @@ HsvColor="{Binding HsvColor, ElementName=ColorSpectrum}" HorizontalAlignment="Center" VerticalAlignment="Stretch" - Margin="12,0,0,0"> + Margin="12,0,0,0" + IsEnabled="{TemplateBinding IsAlphaEnabled}"> - @@ -564,7 +563,8 @@ BorderBrush="{DynamicResource TextControlBorderBrush}" BorderThickness="1,1,0,1" CornerRadius="4,0,0,4" - VerticalAlignment="Center"> + VerticalAlignment="Center" + IsEnabled="{TemplateBinding IsAlphaEnabled}"> - + Value="{Binding Value, ElementName=AlphaComponentSlider}" + IsEnabled="{TemplateBinding IsAlphaEnabled}"> - + VerticalAlignment="Center" + IsEnabled="{TemplateBinding IsAlphaEnabled}"> -