mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-20 05:54:23 +00:00
a11y audit + fixes on profiles page
This commit is contained in:
@@ -127,6 +127,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
_NotifyChanges(L"TabColorPreview");
|
||||
}
|
||||
else if (viewModelProperty == L"Hidden")
|
||||
{
|
||||
_NotifyChanges(L"AccessibleStateDescription");
|
||||
}
|
||||
});
|
||||
|
||||
_defaultAppearanceViewModel.PropertyChanged([this](auto&&, const PropertyChangedEventArgs& args) {
|
||||
@@ -348,6 +352,27 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
return _profile.Orphaned();
|
||||
}
|
||||
|
||||
hstring ProfileViewModel::AccessibleStateDescription() const
|
||||
{
|
||||
const auto hidden = Hidden();
|
||||
const auto orphaned = Orphaned();
|
||||
if (hidden && orphaned)
|
||||
{
|
||||
return til::hstring_format(FMT_COMPILE(L"{}, {}"),
|
||||
RS_(L"Profile_HiddenBadge/[using:Windows.UI.Xaml.Controls]ToolTipService/ToolTip"),
|
||||
RS_(L"Profile_OrphanedBadge/[using:Windows.UI.Xaml.Controls]ToolTipService/ToolTip"));
|
||||
}
|
||||
if (hidden)
|
||||
{
|
||||
return RS_(L"Profile_HiddenBadge/[using:Windows.UI.Xaml.Controls]ToolTipService/ToolTip");
|
||||
}
|
||||
if (orphaned)
|
||||
{
|
||||
return RS_(L"Profile_OrphanedBadge/[using:Windows.UI.Xaml.Controls]ToolTipService/ToolTip");
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
hstring ProfileViewModel::TabTitlePreview() const
|
||||
{
|
||||
if (const auto tabTitle{ TabTitle() }; !tabTitle.empty())
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
bool RepositionCursorWithMouseAvailable() const noexcept;
|
||||
|
||||
bool Orphaned() const;
|
||||
hstring AccessibleStateDescription() const;
|
||||
hstring TabTitlePreview() const;
|
||||
hstring AnswerbackMessagePreview() const;
|
||||
Windows::UI::Color TabColorPreview() const;
|
||||
|
||||
@@ -106,6 +106,7 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
void DeleteUnfocusedAppearance();
|
||||
|
||||
Boolean Orphaned { get; };
|
||||
String AccessibleStateDescription { get; };
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Name);
|
||||
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Guid, Guid);
|
||||
OBSERVABLE_PROJECTED_PROFILE_SETTING(String, Source);
|
||||
|
||||
@@ -20,7 +20,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
InitializeComponent();
|
||||
|
||||
Automation::AutomationProperties::SetName(DefaultsNavigator(), RS_(L"Profiles_DefaultsNavigator_Title/Text"));
|
||||
Automation::AutomationProperties::SetHelpText(DefaultsNavigator(), RS_(L"Profiles_DefaultsNavigator_Description/Text"));
|
||||
Automation::AutomationProperties::SetName(ColorSchemesNavigator(), RS_(L"Profiles_ColorSchemesNavigator_Title/Text"));
|
||||
Automation::AutomationProperties::SetHelpText(ColorSchemesNavigator(), RS_(L"Profiles_ColorSchemesNavigator_Description/Text"));
|
||||
Automation::AutomationProperties::SetName(AddProfileButton(), RS_(L"Profiles_AddProfileButton/Text"));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<DataTemplate x:Key="ProfileNavigatorTemplate"
|
||||
x:DataType="local:ProfileViewModel">
|
||||
<Button HorizontalAlignment="Stretch"
|
||||
AutomationProperties.HelpText="{x:Bind AccessibleStateDescription, Mode=OneWay}"
|
||||
AutomationProperties.Name="{x:Bind Name, Mode=OneWay}"
|
||||
Click="Profile_Click"
|
||||
Style="{StaticResource NavigatorButtonStyle}">
|
||||
@@ -69,7 +70,8 @@
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
|
||||
<StackPanel Style="{StaticResource SettingsStackStyle}">
|
||||
<StackPanel Style="{StaticResource SettingsStackStyle}"
|
||||
XYFocusKeyboardNavigation="Enabled">
|
||||
|
||||
<!-- General Profile Settings -->
|
||||
<TextBlock x:Uid="Profiles_GeneralSettingsHeader"
|
||||
@@ -123,8 +125,10 @@
|
||||
|
||||
<!-- List of profiles. Each is a NavigatorButtonStyle button rendered by ProfileNavigatorTemplate. -->
|
||||
<ItemsControl Margin="0,0,0,16"
|
||||
IsTabStop="False"
|
||||
ItemTemplate="{StaticResource ProfileNavigatorTemplate}"
|
||||
ItemsSource="{x:Bind ViewModel.Profiles, Mode=OneWay}">
|
||||
ItemsSource="{x:Bind ViewModel.Profiles, Mode=OneWay}"
|
||||
XYFocusKeyboardNavigation="Enabled">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel />
|
||||
|
||||
Reference in New Issue
Block a user