From b84e9da00506d93a44ce5a4add260259fc75ef25 Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Fri, 21 May 2021 15:57:57 +0200 Subject: [PATCH] [ColorPicker] Improving keyboard navigation (#11384) * Fix keyboard navigation * Fix button * HIerarchy * Place flyout at the bottom Co-authored-by: Niels Laute --- .../Controls/ColorFormatControl.xaml | 46 +- .../Controls/ColorPickerControl.xaml | 633 +++++++++++------- .../Controls/ColorPickerControl.xaml.cs | 86 +-- .../Properties/Resources.Designer.cs | 18 +- .../ColorPickerUI/Properties/Resources.resx | 6 +- .../ColorPickerUI/Resources/Styles.xaml | 35 +- .../ColorPickerUI/Views/ColorEditorView.xaml | 46 +- 7 files changed, 486 insertions(+), 384 deletions(-) diff --git a/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml b/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml index 25d3c66d46..29bc856ed1 100644 --- a/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Controls/ColorFormatControl.xaml @@ -1,22 +1,18 @@  - - - + + Margin="12,16,12,0" + Width="308" + Height="36" + CornerRadius="2" + HorizontalAlignment="Stretch" + Background="{DynamicResource ColorControlBackgroundBrush}"> @@ -42,32 +38,22 @@ IsReadOnly="True" VerticalAlignment="Center" Padding="8" - AutomationProperties.LabeledBy="{Binding FormatNameTextBlock}" + AutomationProperties.LabeledBy="{Binding ElementName=FormatNameTextBlock, Path=Text}" /> + AutomationProperties.Name="{x:Static p:Resources.Copy_to_clipboard}" + FontSize="12" + Style="{StaticResource DefaultButtonStyle}" + FontFamily="Segoe MDL2 Assets" + Content="" /> diff --git a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml index 0c6aa774fa..e733178df1 100644 --- a/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml +++ b/src/modules/colorPicker/ColorPickerUI/Controls/ColorPickerControl.xaml @@ -7,66 +7,283 @@ xmlns:p="clr-namespace:ColorPicker.Properties" xmlns:ui="http://schemas.modernwpf.com/2019" mc:Ignorable="d" - Height="350" - Width="333"> - - - + TabIndex="3" + FocusManager.IsFocusScope="True" + KeyboardNavigation.TabNavigation="Once" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -