fix: enhance diff view by truncating long file paths with ellipsis and adding tooltips for full path display

This commit is contained in:
Gadfly 2024-04-13 01:33:44 +08:00
parent 83728c1a5f
commit f7dd856e49
No known key found for this signature in database
GPG key ID: 9128145F93CFC69C

View file

@ -20,11 +20,12 @@
<TextBlock Margin="8,0,0,0" Text="→"/> <TextBlock Margin="8,0,0,0" Text="→"/>
</StackPanel> </StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center"> <DockPanel Grid.Column="1" VerticalAlignment="Center">
<Path Width="12" Height="12" Data="{StaticResource Icons.File}" Margin="8,0,0,0"/> <Path DockPanel.Dock="Left" Width="12" Height="12" Data="{StaticResource Icons.File}" Margin="8,0,0,0"/>
<TextBlock Classes="monospace" Margin="4,0,0,0" Text="{Binding FilePath, Converter={x:Static c:PathConverters.TruncateIfTooLong}}" FontSize="11"/> <TextBlock Classes="monospace" Margin="4,0,0,0" Text="{Binding FilePath, Converter={x:Static c:PathConverters.TruncateIfTooLong}}"
<Path Classes="rotating" Width="10" Height="10" Margin="8,0" Data="{DynamicResource Icons.Loading}" IsVisible="{Binding IsLoading}"/> TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" ToolTip.Tip="{Binding FilePath}" FontSize="11"/>
</StackPanel> <Path DockPanel.Dock="Right" Classes="rotating" Width="10" Height="10" Margin="8,0" Data="{StaticResource Icons.Loading}" IsVisible="{Binding IsLoading}"/>
</DockPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" IsVisible="{Binding FileModeDiff, Converter={x:Static c:ObjectConverters.IsNotNull}}"> <StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" IsVisible="{Binding FileModeDiff, Converter={x:Static c:ObjectConverters.IsNotNull}}">
<TextBlock Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.Diff.FileModeChanged}" FontSize="11"/> <TextBlock Classes="monospace" Margin="8,0,0,0" Text="{DynamicResource Text.Diff.FileModeChanged}" FontSize="11"/>