mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 02:09:24 +08:00
[FancyZones Editor][Accessibility] Default focused elements in all FancyZones Editor windows (#7971)
* Default focused elements * Fix focus when starting editor from settings
This commit is contained in:
parent
6a580c720a
commit
102f42928c
@ -176,7 +176,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<StackPanel>
|
<StackPanel FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
|
||||||
<TextBlock Name="windowEditorDialogTitle" Text="{x:Static props:Resources.Custom_Layout_Creator}" Style="{StaticResource titleText}" />
|
<TextBlock Name="windowEditorDialogTitle" Text="{x:Static props:Resources.Custom_Layout_Creator}" Style="{StaticResource titleText}" />
|
||||||
<Button x:Name="newZoneButton" AutomationProperties.LabeledBy="{Binding ElementName=newZoneName}" Width="496" Height="136" Style="{StaticResource newZoneButton}" Click="OnAddZone">
|
<Button x:Name="newZoneButton" AutomationProperties.LabeledBy="{Binding ElementName=newZoneName}" Width="496" Height="136" Style="{StaticResource newZoneButton}" Click="OnAddZone">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
|
|
||||||
<TextBlock Text="{x:Static props:Resources.Note_Custom_Table}" Style="{StaticResource textLabel}" TextWrapping="Wrap" />
|
<TextBlock Text="{x:Static props:Resources.Note_Custom_Table}" Style="{StaticResource textLabel}" TextWrapping="Wrap" />
|
||||||
<TextBlock x:Name="customLayoutName" Text="{x:Static props:Resources.Name}" Style="{StaticResource textLabel}" />
|
<TextBlock x:Name="customLayoutName" Text="{x:Static props:Resources.Name}" Style="{StaticResource textLabel}" />
|
||||||
<TextBox Text="{Binding Name}" AutomationProperties.LabeledBy="{Binding ElementName=customLayoutName}" Style="{StaticResource textBox}" />
|
<TextBox Name="customLayoutNameTextBox" Text="{Binding Name}" GotFocus="NameTextBox_GotFocus" AutomationProperties.LabeledBy="{Binding ElementName=customLayoutName}" Style="{StaticResource textBox}" />
|
||||||
<!--
|
<!--
|
||||||
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
|
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
|
||||||
<CheckBox x:Name="showGridSetting" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="True" Margin="21,4,0,0"/>
|
<CheckBox x:Name="showGridSetting" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="True" Margin="21,4,0,0"/>
|
||||||
|
@ -38,5 +38,15 @@ namespace FancyZonesEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
private GridLayoutModel _stashedModel;
|
private GridLayoutModel _stashedModel;
|
||||||
|
|
||||||
|
private void NameTextBox_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
customLayoutNameTextBox.CaretIndex = customLayoutNameTextBox.Text.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public System.Windows.Controls.TextBox NameTextBox()
|
||||||
|
{
|
||||||
|
return customLayoutNameTextBox;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,8 +187,8 @@
|
|||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel FocusManager.FocusedElement="{Binding ElementName=decrementZones}">
|
||||||
|
|
||||||
<TextBlock Name="DialogTitle" Text="{x:Static props:Resources.Choose_Layout}" Style="{StaticResource titleText}" />
|
<TextBlock Name="DialogTitle" Text="{x:Static props:Resources.Choose_Layout}" Style="{StaticResource titleText}" />
|
||||||
|
|
||||||
|
@ -154,9 +154,11 @@ namespace FancyZonesEditor
|
|||||||
mainEditor.Edit();
|
mainEditor.Edit();
|
||||||
|
|
||||||
EditorWindow window;
|
EditorWindow window;
|
||||||
|
bool isGrid = false;
|
||||||
if (model is GridLayoutModel)
|
if (model is GridLayoutModel)
|
||||||
{
|
{
|
||||||
window = new GridEditorWindow();
|
window = new GridEditorWindow();
|
||||||
|
isGrid = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -166,6 +168,10 @@ namespace FancyZonesEditor
|
|||||||
window.Owner = EditorOverlay.Current;
|
window.Owner = EditorOverlay.Current;
|
||||||
window.DataContext = model;
|
window.DataContext = model;
|
||||||
window.Show();
|
window.Show();
|
||||||
|
if (isGrid)
|
||||||
|
{
|
||||||
|
(window as GridEditorWindow).NameTextBox().Focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Apply_Click(object sender, RoutedEventArgs e)
|
private void Apply_Click(object sender, RoutedEventArgs e)
|
||||||
|
@ -724,7 +724,7 @@ void FancyZones::ToggleEditor() noexcept
|
|||||||
sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI };
|
sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI };
|
||||||
sei.lpFile = NonLocalizable::FZEditorExecutablePath;
|
sei.lpFile = NonLocalizable::FZEditorExecutablePath;
|
||||||
sei.lpParameters = params.c_str();
|
sei.lpParameters = params.c_str();
|
||||||
sei.nShow = SW_SHOWNORMAL;
|
sei.nShow = SW_SHOWDEFAULT;
|
||||||
ShellExecuteEx(&sei);
|
ShellExecuteEx(&sei);
|
||||||
Trace::FancyZones::EditorLaunched(1);
|
Trace::FancyZones::EditorLaunched(1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user