mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Enable SSH Generator Feature Flag and polish UI (#18814)
This commit is contained in:
parent
36162ae6b1
commit
3ae6bbf2df
Binary file not shown.
|
Before Width: | Height: | Size: 647 B |
Binary file not shown.
|
Before Width: | Height: | Size: 787 B |
@ -500,6 +500,12 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||||||
{
|
{
|
||||||
if (!extPkgVM.Package().DisplayName().empty())
|
if (!extPkgVM.Package().DisplayName().empty())
|
||||||
{
|
{
|
||||||
|
// Check if the first char of the icon is in the Segoe MDL2 Icons list
|
||||||
|
const auto ch = til::at(extPkgVM.Package().Icon(), 0);
|
||||||
|
if (ch >= L'\uE700' && ch <= L'\uF8FF')
|
||||||
|
{
|
||||||
|
return ComplexTemplateWithFontIcon();
|
||||||
|
}
|
||||||
return ComplexTemplate();
|
return ComplexTemplate();
|
||||||
}
|
}
|
||||||
return DefaultTemplate();
|
return DefaultTemplate();
|
||||||
|
|||||||
@ -183,6 +183,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||||||
|
|
||||||
WINRT_PROPERTY(Windows::UI::Xaml::DataTemplate, DefaultTemplate, nullptr);
|
WINRT_PROPERTY(Windows::UI::Xaml::DataTemplate, DefaultTemplate, nullptr);
|
||||||
WINRT_PROPERTY(Windows::UI::Xaml::DataTemplate, ComplexTemplate, nullptr);
|
WINRT_PROPERTY(Windows::UI::Xaml::DataTemplate, ComplexTemplate, nullptr);
|
||||||
|
WINRT_PROPERTY(Windows::UI::Xaml::DataTemplate, ComplexTemplateWithFontIcon, nullptr);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -77,5 +77,6 @@ namespace Microsoft.Terminal.Settings.Editor
|
|||||||
|
|
||||||
Windows.UI.Xaml.DataTemplate DefaultTemplate;
|
Windows.UI.Xaml.DataTemplate DefaultTemplate;
|
||||||
Windows.UI.Xaml.DataTemplate ComplexTemplate;
|
Windows.UI.Xaml.DataTemplate ComplexTemplate;
|
||||||
|
Windows.UI.Xaml.DataTemplate ComplexTemplateWithFontIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
<local:ExtensionPackageTemplateSelector x:Key="ExtensionPackageIdentifierTemplateSelector"
|
<local:ExtensionPackageTemplateSelector x:Key="ExtensionPackageIdentifierTemplateSelector"
|
||||||
ComplexTemplate="{StaticResource ComplexExtensionIdentifierTemplate}"
|
ComplexTemplate="{StaticResource ComplexExtensionIdentifierTemplate}"
|
||||||
|
ComplexTemplateWithFontIcon="{StaticResource ComplexExtensionIdentifierTemplateWithFontIcon}"
|
||||||
DefaultTemplate="{StaticResource DefaultExtensionIdentifierTemplate}" />
|
DefaultTemplate="{StaticResource DefaultExtensionIdentifierTemplate}" />
|
||||||
|
|
||||||
<DataTemplate x:Key="DefaultExtensionIdentifierTemplate"
|
<DataTemplate x:Key="DefaultExtensionIdentifierTemplate"
|
||||||
@ -91,8 +92,37 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="ComplexExtensionIdentifierTemplateWithFontIcon"
|
||||||
|
x:DataType="local:ExtensionPackageViewModel">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<FontIcon Grid.Row="0"
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="0,0,8,0"
|
||||||
|
FontSize="32"
|
||||||
|
Glyph="{x:Bind Package.Icon}" />
|
||||||
|
<TextBlock Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{x:Bind Package.DisplayName}" />
|
||||||
|
<TextBlock Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Style="{StaticResource SettingsPageItemDescriptionStyle}"
|
||||||
|
Text="{x:Bind Package.Source}" />
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
<local:ExtensionPackageTemplateSelector x:Key="ExtensionPackageNavigatorTemplateSelector"
|
<local:ExtensionPackageTemplateSelector x:Key="ExtensionPackageNavigatorTemplateSelector"
|
||||||
ComplexTemplate="{StaticResource ComplexExtensionNavigatorTemplate}"
|
ComplexTemplate="{StaticResource ComplexExtensionNavigatorTemplate}"
|
||||||
|
ComplexTemplateWithFontIcon="{StaticResource ComplexExtensionNavigatorTemplateWithFontIcon}"
|
||||||
DefaultTemplate="{StaticResource DefaultExtensionNavigatorTemplate}" />
|
DefaultTemplate="{StaticResource DefaultExtensionNavigatorTemplate}" />
|
||||||
|
|
||||||
<DataTemplate x:Key="DefaultExtensionNavigatorTemplate"
|
<DataTemplate x:Key="DefaultExtensionNavigatorTemplate"
|
||||||
@ -146,6 +176,31 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="ComplexExtensionNavigatorTemplateWithFontIcon"
|
||||||
|
x:DataType="local:ExtensionPackageViewModel">
|
||||||
|
<Button AutomationProperties.Name="{x:Bind AccessibleName}"
|
||||||
|
Click="ExtensionNavigator_Click"
|
||||||
|
Style="{StaticResource NavigatorButtonStyle}"
|
||||||
|
Tag="{x:Bind}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<ContentPresenter Content="{x:Bind}"
|
||||||
|
ContentTemplate="{StaticResource ComplexExtensionIdentifierTemplateWithFontIcon}" />
|
||||||
|
|
||||||
|
<ToggleSwitch Grid.Column="1"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
AutomationProperties.Name="{x:Bind AccessibleName}"
|
||||||
|
IsOn="{x:Bind Enabled, Mode=TwoWay}"
|
||||||
|
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
<DataTemplate x:Key="FragmentProfileViewModelTemplate"
|
<DataTemplate x:Key="FragmentProfileViewModelTemplate"
|
||||||
x:DataType="local:FragmentProfileViewModel">
|
x:DataType="local:FragmentProfileViewModel">
|
||||||
<muxc:Expander AutomationProperties.Name="{x:Bind AccessibleName}"
|
<muxc:Expander AutomationProperties.Name="{x:Bind AccessibleName}"
|
||||||
|
|||||||
@ -12,8 +12,8 @@
|
|||||||
static constexpr std::wstring_view SshHostGeneratorNamespace{ L"Windows.Terminal.SSH" };
|
static constexpr std::wstring_view SshHostGeneratorNamespace{ L"Windows.Terminal.SSH" };
|
||||||
|
|
||||||
static constexpr std::wstring_view PROFILE_TITLE_PREFIX = L"SSH - ";
|
static constexpr std::wstring_view PROFILE_TITLE_PREFIX = L"SSH - ";
|
||||||
static constexpr std::wstring_view PROFILE_ICON_PATH = L"ms-appx:///ProfileIcons/{550ce7b8-d500-50ad-8a1a-c400c3262db3}.png";
|
static constexpr std::wstring_view PROFILE_ICON_PATH = L"\uE977"; // PC1
|
||||||
static constexpr std::wstring_view GENERATOR_ICON_PATH = L"ms-appx:///ProfileGeneratorIcons/SSH.png";
|
static constexpr std::wstring_view GENERATOR_ICON_PATH = L"\uE969"; // StorageNetworkWireless
|
||||||
|
|
||||||
// OpenSSH is installed under System32 when installed via Optional Features
|
// OpenSSH is installed under System32 when installed via Optional Features
|
||||||
static constexpr std::wstring_view SSH_EXE_PATH1 = L"%SystemRoot%\\System32\\OpenSSH\\ssh.exe";
|
static constexpr std::wstring_view SSH_EXE_PATH1 = L"%SystemRoot%\\System32\\OpenSSH\\ssh.exe";
|
||||||
|
|||||||
@ -100,6 +100,11 @@
|
|||||||
<description>Enables the dynamic profile generator for OpenSSH config files</description>
|
<description>Enables the dynamic profile generator for OpenSSH config files</description>
|
||||||
<id>9031</id>
|
<id>9031</id>
|
||||||
<stage>AlwaysDisabled</stage>
|
<stage>AlwaysDisabled</stage>
|
||||||
|
<alwaysEnabledBrandingTokens>
|
||||||
|
<brandingToken>Dev</brandingToken>
|
||||||
|
<brandingToken>Canary</brandingToken>
|
||||||
|
<brandingToken>Preview</brandingToken>
|
||||||
|
</alwaysEnabledBrandingTokens>
|
||||||
</feature>
|
</feature>
|
||||||
|
|
||||||
<feature>
|
<feature>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user