Browse Source

Fix handling of full-length hex values with '#' symbol in ColorPicker

This allows pasting i.e. '#FFFFFFFF' in the hex input text box
pull/10085/head
robloo 4 years ago
parent
commit
a8aa64b4c0
  1. 3
      src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml
  2. 3
      src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml
  3. 3
      src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorPicker.xaml
  4. 3
      src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorView.xaml

3
src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPicker.xaml

@ -245,11 +245,12 @@
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Border> </Border>
<!-- Color updated in code-behind --> <!-- Color updated in code-behind -->
<!-- Max length must include an optional '#' prefix (#FFFFFFFF) -->
<TextBox x:Name="PART_HexTextBox" <TextBox x:Name="PART_HexTextBox"
Grid.Column="1" Grid.Column="1"
AutomationProperties.Name="Hexadecimal Color" AutomationProperties.Name="Hexadecimal Color"
Height="32" Height="32"
MaxLength="8" MaxLength="9"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
CornerRadius="0,4,4,0" /> CornerRadius="0,4,4,0" />
</Grid> </Grid>

3
src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorView.xaml

@ -494,11 +494,12 @@
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Border> </Border>
<!-- Color updated in code-behind --> <!-- Color updated in code-behind -->
<!-- Max length must include an optional '#' prefix (#FFFFFFFF) -->
<TextBox x:Name="PART_HexTextBox" <TextBox x:Name="PART_HexTextBox"
Grid.Column="1" Grid.Column="1"
AutomationProperties.Name="Hexadecimal Color" AutomationProperties.Name="Hexadecimal Color"
Height="32" Height="32"
MaxLength="8" MaxLength="9"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
CornerRadius="0,4,4,0" /> CornerRadius="0,4,4,0" />
</Grid> </Grid>

3
src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorPicker.xaml

@ -245,11 +245,12 @@
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Border> </Border>
<!-- Color updated in code-behind --> <!-- Color updated in code-behind -->
<!-- Max length must include an optional '#' prefix (#FFFFFFFF) -->
<TextBox x:Name="PART_HexTextBox" <TextBox x:Name="PART_HexTextBox"
Grid.Column="1" Grid.Column="1"
AutomationProperties.Name="Hexadecimal Color" AutomationProperties.Name="Hexadecimal Color"
Height="32" Height="32"
MaxLength="8" MaxLength="9"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
CornerRadius="0,0,0,0" /> CornerRadius="0,0,0,0" />
</Grid> </Grid>

3
src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorView.xaml

@ -456,11 +456,12 @@
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Border> </Border>
<!-- Color updated in code-behind --> <!-- Color updated in code-behind -->
<!-- Max length must include an optional '#' prefix (#FFFFFFFF) -->
<TextBox x:Name="PART_HexTextBox" <TextBox x:Name="PART_HexTextBox"
Grid.Column="1" Grid.Column="1"
AutomationProperties.Name="Hexadecimal Color" AutomationProperties.Name="Hexadecimal Color"
Height="32" Height="32"
MaxLength="8" MaxLength="9"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
CornerRadius="0,0,0,0" /> CornerRadius="0,0,0,0" />
</Grid> </Grid>

Loading…
Cancel
Save