Skip to content

Commit

Permalink
[Windows 10] Fix layout in New Tab Menu page
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Jan 14, 2025
1 parent ba87ab5 commit 199f0ca
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/cascadia/TerminalSettingsEditor/NewTabMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--
BODGY: We want two columns of content:
1. the identifier (e.g. profile name), aligned left
2. the buttons (e.g. reorder, delete), aligned right
There's a bug in WinUI 2 for Windows 10 where these nested columns are treated as "auto" instead
of *-sized. To work around this, we can set the width of the first column's content to
StandardControlMaxWidth. The first column will be clipped as necessary to make space for the second column,
resulting in the desired layout.
-->
<ContentPresenter Grid.Column="0"
Width="{StaticResource StandardControlMaxWidth}"
Content="{TemplateBinding Content}" />
<StackPanel Grid.Column="1"
Orientation="Horizontal"
Expand Down Expand Up @@ -127,7 +137,17 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--
BODGY: We want two columns of content:
1. the identifier (e.g. profile name), aligned left
2. the buttons (e.g. reorder, delete), aligned right
There's a bug in WinUI 2 for Windows 10 where these nested columns are treated as "auto" instead
of *-sized. To work around this, we can set the width of the first column's content to
StandardControlMaxWidth. The first column will be clipped as necessary to make space for the second column,
resulting in the desired layout.
-->
<StackPanel Grid.Column="0"
Width="{StaticResource StandardControlMaxWidth}"
Orientation="Horizontal">
<IconSourceElement Width="16"
Height="16"
Expand Down

0 comments on commit 199f0ca

Please sign in to comment.