[CmdPal] Better support for long labels in empty content and commandbar (#38974)

Closes: #38970

Before:
<img width="605" alt="image" src="https://github.com/user-attachments/assets/8310e08f-c471-4663-9000-bfd1eb8c99f3" />

After:
<img width="514" alt="image" src="https://github.com/user-attachments/assets/b1e4c5f6-cd6b-42b2-9a23-3e1e3642202a" />
This commit is contained in:
Niels Laute
2025-04-23 13:40:33 +02:00
committed by GitHub
parent 884bfc71d3
commit f085ba0cd2
2 changed files with 12 additions and 5 deletions

View File

@@ -71,9 +71,9 @@
Padding="4" Padding="4"
ColumnSpacing="8"> ColumnSpacing="8">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid <Grid
@@ -133,6 +133,8 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}" Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind CurrentPageViewModel.Title, Mode=OneWay}" Text="{x:Bind CurrentPageViewModel.Title, Mode=OneWay}"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Visibility="{x:Bind CurrentPageViewModel.IsNested, Mode=OneWay}" /> Visibility="{x:Bind CurrentPageViewModel.IsNested, Mode=OneWay}" />
<StackPanel <StackPanel
Grid.Column="2" Grid.Column="2"

View File

@@ -138,14 +138,15 @@
</controls:Case> </controls:Case>
<controls:Case Value="True"> <controls:Case Value="True">
<StackPanel <StackPanel
Margin="24"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Orientation="Vertical" Orientation="Vertical"
Spacing="4"> Spacing="4">
<cpcontrols:IconBox <cpcontrols:IconBox
x:Name="IconBorder" x:Name="IconBorder"
Width="56" Width="48"
Height="56" Height="48"
Margin="8" Margin="8"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" Foreground="{ThemeResource TextFillColorSecondaryBrush}"
SourceKey="{x:Bind ViewModel.EmptyContent.Icon, Mode=OneWay}" SourceKey="{x:Bind ViewModel.EmptyContent.Icon, Mode=OneWay}"
@@ -154,11 +155,15 @@
Margin="0,4,0,0" Margin="0,4,0,0"
HorizontalAlignment="Center" HorizontalAlignment="Center"
FontWeight="SemiBold" FontWeight="SemiBold"
Text="{x:Bind ViewModel.EmptyContent.Title, Mode=OneWay}" /> Text="{x:Bind ViewModel.EmptyContent.Title, Mode=OneWay}"
TextAlignment="Center"
TextWrapping="Wrap" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="{x:Bind ViewModel.EmptyContent.Subtitle, Mode=OneWay}" /> Text="{x:Bind ViewModel.EmptyContent.Subtitle, Mode=OneWay}"
TextAlignment="Center"
TextWrapping="Wrap" />
</StackPanel> </StackPanel>
</controls:Case> </controls:Case>
</controls:SwitchPresenter> </controls:SwitchPresenter>