mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
prop names
This commit is contained in:
parent
b1550c867d
commit
9c50b62d81
@ -147,7 +147,7 @@
|
||||
<!-- Templates -->
|
||||
<DataTemplate x:Key="CommandTemplate"
|
||||
x:DataType="local:CommandViewModel">
|
||||
<ListViewItem AutomationProperties.Name="{x:Bind DisplayName, Mode=OneWay}"
|
||||
<ListViewItem AutomationProperties.Name="{x:Bind DisplayNameAndKeyChordAutomationPropName, Mode=OneWay}"
|
||||
Style="{StaticResource KeyBindingContainerStyle}">
|
||||
<Grid ColumnSpacing="8">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@ -286,11 +286,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
|
||||
winrt::hstring CommandViewModel::Name()
|
||||
{
|
||||
if (_command.HasName())
|
||||
{
|
||||
return _command.Name();
|
||||
}
|
||||
return L"";
|
||||
return _command.HasName() ? _command.Name() : L"";
|
||||
}
|
||||
|
||||
void CommandViewModel::Name(const winrt::hstring& newName)
|
||||
@ -299,10 +295,15 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
if (newName.empty())
|
||||
{
|
||||
// if the name was cleared, refresh the DisplayName
|
||||
_NotifyChanges(L"DisplayName");
|
||||
_NotifyChanges(L"DisplayName", L"DisplayNameAndKeyChordAutomationPropName");
|
||||
}
|
||||
}
|
||||
|
||||
winrt::hstring CommandViewModel::DisplayNameAndKeyChordAutomationPropName()
|
||||
{
|
||||
return DisplayName() + L" " + FirstKeyChordText();
|
||||
}
|
||||
|
||||
winrt::hstring CommandViewModel::FirstKeyChordText()
|
||||
{
|
||||
if (_KeyChordViewModelList.Size() != 0)
|
||||
@ -350,6 +351,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
return RS_(L"Actions_ShortcutAction/Text");
|
||||
}
|
||||
|
||||
winrt::hstring CommandViewModel::AdditionalArgumentsControlAutomationPropName()
|
||||
{
|
||||
return RS_(L"Actions_Arguments/Text");
|
||||
}
|
||||
|
||||
void CommandViewModel::_RegisterKeyChordVMEvents(Editor::KeyChordViewModel kcVM)
|
||||
{
|
||||
const auto id = ID();
|
||||
|
||||
@ -93,6 +93,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
winrt::hstring DisplayName();
|
||||
winrt::hstring Name();
|
||||
void Name(const winrt::hstring& newName);
|
||||
winrt::hstring DisplayNameAndKeyChordAutomationPropName();
|
||||
|
||||
winrt::hstring FirstKeyChordText();
|
||||
|
||||
@ -110,6 +111,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
// UIA text
|
||||
winrt::hstring ActionNameTextBoxAutomationPropName();
|
||||
winrt::hstring ShortcutActionComboBoxAutomationPropName();
|
||||
winrt::hstring AdditionalArgumentsControlAutomationPropName();
|
||||
|
||||
til::typed_event<IInspectable, Editor::ArgWrapper> PropagateColorSchemeRequested;
|
||||
til::typed_event<IInspectable, Editor::ArgWrapper> PropagateColorSchemeNamesRequested;
|
||||
|
||||
@ -33,6 +33,7 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
// View-model specific
|
||||
String DisplayName { get; };
|
||||
String FirstKeyChordText { get; };
|
||||
String DisplayNameAndKeyChordAutomationPropName { get; };
|
||||
|
||||
// UI side (command list page)
|
||||
void Edit_Click();
|
||||
@ -50,6 +51,7 @@ namespace Microsoft.Terminal.Settings.Editor
|
||||
// UI side (edit command page, automation property names)
|
||||
String ActionNameTextBoxAutomationPropName { get; };
|
||||
String ShortcutActionComboBoxAutomationPropName { get; };
|
||||
String AdditionalArgumentsControlAutomationPropName { get; };
|
||||
}
|
||||
|
||||
runtimeclass ArgWrapper : Windows.UI.Xaml.Data.INotifyPropertyChanged
|
||||
|
||||
@ -667,6 +667,7 @@
|
||||
<ItemsControl Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
IsTabStop="False"
|
||||
AutomationProperties.Name="{x:Bind ViewModel.AdditionalArgumentsControlAutomationPropName}"
|
||||
ItemTemplateSelector="{StaticResource ArgsTemplateSelector}"
|
||||
ItemsSource="{x:Bind ViewModel.ActionArgsVM.ArgValues, Mode=OneWay}" />
|
||||
<TextBlock x:Uid="Actions_Keybindings"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user