61 lines
3.2 KiB
XML
61 lines
3.2 KiB
XML
<Window x:Class="Explorer.App.GitDiffWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
Title="{Binding Title}"
|
|
Icon="pack://application:,,,/Assets/explorer-workbench.ico"
|
|
Height="640" Width="860"
|
|
MinHeight="360" MinWidth="520"
|
|
WindowStartupLocation="CenterOwner"
|
|
Background="{DynamicResource Bg}" Foreground="{DynamicResource Fg}">
|
|
<DockPanel Margin="16">
|
|
<Button DockPanel.Dock="Bottom" Content="Close" MinWidth="88" Height="32" HorizontalAlignment="Right"
|
|
Click="OnClose" Margin="0,12,0,0"/>
|
|
<TextBlock DockPanel.Dock="Top" Text="{Binding EmptyText}" Margin="0,0,0,8"
|
|
Foreground="{DynamicResource FgMuted}" TextWrapping="Wrap"
|
|
Visibility="{Binding ShowEmpty, Converter={StaticResource BoolVis}}"/>
|
|
<ListBox ItemsSource="{Binding Lines}" FontFamily="Consolas" FontSize="13"
|
|
Background="{DynamicResource InputBg}" BorderBrush="{DynamicResource Stroke}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
VirtualizingPanel.IsVirtualizing="True"
|
|
VirtualizingPanel.VirtualizationMode="Recycling">
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="ListBoxItem">
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="Margin" Value="0"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="Focusable" Value="False"/>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Text}" FontFamily="Consolas" Padding="8,1" TextWrapping="NoWrap">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="{DynamicResource Fg}"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Kind}" Value="Added">
|
|
<Setter Property="Foreground" Value="{DynamicResource GitDiffAdded}"/>
|
|
<Setter Property="Background" Value="{DynamicResource GitDiffAddedBg}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Kind}" Value="Removed">
|
|
<Setter Property="Foreground" Value="{DynamicResource GitDiffRemoved}"/>
|
|
<Setter Property="Background" Value="{DynamicResource GitDiffRemovedBg}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Kind}" Value="Hunk">
|
|
<Setter Property="Foreground" Value="{DynamicResource GitDiffHunk}"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Kind}" Value="Meta">
|
|
<Setter Property="Foreground" Value="{DynamicResource FgMuted}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
</Window>
|