Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUI] Polish Launch Parameters setting controls #14569

Merged
3 commits merged into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cascadia/TerminalSettingsEditor/CommonResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<!-- Number Box -->
<Style x:Key="NumberBoxSettingStyle"
TargetType="muxc:NumberBox">
<Setter Property="SpinButtonPlacementMode" Value="Inline" />
<Setter Property="SpinButtonPlacementMode" Value="Compact" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>

Expand Down
48 changes: 32 additions & 16 deletions src/cascadia/TerminalSettingsEditor/Launch.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,25 +227,41 @@
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center" />
<StackPanel Grid.Row="1"
Grid.Column="1">
<StackPanel Orientation="Horizontal"
Spacing="4">
<muxc:NumberBox x:Name="PosXBox"
x:Uid="Globals_InitialPosXBox"
IsEnabled="{x:Bind local:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosX, Mode=TwoWay}" />
<muxc:NumberBox x:Name="PosYBox"
x:Uid="Globals_InitialPosYBox"
IsEnabled="{x:Bind local:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosY, Mode=TwoWay}" />
</StackPanel>
<Grid Grid.Row="1"
Grid.Column="1"
ColumnSpacing="4">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Match the width of these NumberBoxes to the Width of the LaunchModeComboBox above minus the Grid's ColumnSpacing -->
<muxc:NumberBox x:Name="PosXBox"
x:Uid="Globals_InitialPosXBox"
Grid.Row="0"
Grid.Column="0"
Width="118"
IsEnabled="{x:Bind local:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosX, Mode=TwoWay}" />
<muxc:NumberBox x:Name="PosYBox"
x:Uid="Globals_InitialPosYBox"
Grid.Row="0"
Grid.Column="1"
Width="118"
IsEnabled="{x:Bind local:Converters.InvertBoolean(ViewModel.UseDefaultLaunchPosition), Mode=OneWay}"
Style="{StaticResource LaunchSizeNumberBoxStyle}"
Value="{x:Bind ViewModel.InitialPosY, Mode=TwoWay}" />
<CheckBox x:Name="UseDefaultLaunchPositionCheckbox"
x:Uid="Globals_DefaultLaunchPositionCheckbox"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
IsChecked="{x:Bind ViewModel.UseDefaultLaunchPosition, Mode=TwoWay}" />
</StackPanel>
</Grid>
<TextBlock x:Uid="Globals_CenterOnLaunch"
Grid.Row="2"
Grid.Column="0"
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalSettingsEditor/LaunchViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
// Append the launch position part
if (UseDefaultLaunchPosition())
{
result = fmt::format(L"{}, {}", launchModeString, RS_(L"Globals_LaunchModeDefault/Content"));
result = fmt::format(L"{}, {}", launchModeString, RS_(L"Globals_DefaultLaunchPositionCheckbox/Content"));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@
<comment>The string to be displayed when there is no current value in the y-coordinate number box.</comment>
</data>
<data name="Globals_DefaultLaunchPositionCheckbox.Content" xml:space="preserve">
<value>Use system default</value>
<comment>A checkbox for the "launch position" setting. Toggling this control sets the launch position to the system default.</comment>
<value>Let system position window</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since system == Windows, isn't this like "Let Windows position window"? 😄
I wonder if something like "Let Windows decide" would be better. We already use such a label for "DefaultWindowsConsoleName" after all...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 100% down for "Let Windows decide"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw I chose "let system position window" because:

image

This is okay as well :)

carlos-zamora marked this conversation as resolved.
Show resolved Hide resolved
<comment>A checkbox for the "launch position" setting. Toggling this control sets the launch position to whatever the operating system decides.</comment>
carlos-zamora marked this conversation as resolved.
Show resolved Hide resolved
</data>
<data name="Globals_DefaultLaunchPositionCheckbox.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>If enabled, use the system default launch position.</value>
Expand Down Expand Up @@ -1569,4 +1569,4 @@
<value>Warn when closing more than one tab</value>
<comment>Header for a control to toggle whether to show a confirm dialog box when closing the application with multiple tabs open.</comment>
</data>
</root>
</root>