Skip to content

Commit

Permalink
ListBox: Trim text if it does not fit in available width
Browse files Browse the repository at this point in the history
  • Loading branch information
darklinkpower committed Oct 9, 2023
1 parent 1385dc4 commit 74414f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion source/DefaultControls/ListBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@
<Border Padding="{TemplateBinding Padding}" Background="Transparent">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="3,0,0,0" />
Margin="3,0,0,0">
<ContentPresenter.Resources>
<Style TargetType="TextBlock">
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Border>
</Grid>
<ControlTemplate.Triggers>
Expand Down
2 changes: 1 addition & 1 deletion source/Views/DetailsViewGameOverview.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@
<TextBlock Text="{DynamicResource LOCNotesLabel}" Style="{DynamicResource DetailsViewTabHeaderStyle}" />
</TabItem.Header>
<StackPanel Margin="0,16,0,0">
<TextBlock x:Name="NotesVisibilityProxy">
<TextBlock x:Name="NotesVisibilityProxy" Visibility="Collapsed">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Tag" Value="Collapsed" />
Expand Down
8 changes: 7 additions & 1 deletion source/Views/ExplorerPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@
<ContentPresenter TextBlock.FontSize="{TemplateBinding FontSize}"
TextBlock.FontWeight="{TemplateBinding FontWeight}"
VerticalAlignment="Center"
Margin="13,4,3,4" />
Margin="13,4,3,4">
<ContentPresenter.Resources>
<Style TargetType="TextBlock">
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
Expand Down

0 comments on commit 74414f9

Please sign in to comment.