2024-02-05 23:08:37 -08:00
|
|
|
<UserControl xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:m="using:SourceGit.Models"
|
|
|
|
xmlns:vm="using:SourceGit.ViewModels"
|
|
|
|
xmlns:v="using:SourceGit.Views"
|
|
|
|
xmlns:c="using:SourceGit.Converters"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="SourceGit.Views.RevisionCompare"
|
|
|
|
x:DataType="vm:RevisionCompare"
|
|
|
|
Background="{DynamicResource Brush.Window}">
|
|
|
|
<Grid RowDefinitions="50,*" Margin="4">
|
2024-05-27 06:05:15 -07:00
|
|
|
<Grid Grid.Row="0" Margin="48,0,48,4" ColumnDefinitions="*,48,*">
|
|
|
|
<Border Grid.Column="0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}" CornerRadius="4" Padding="4">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Grid RowDefinitions="Auto,*">
|
2024-05-27 06:05:15 -07:00
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto,Auto">
|
2024-02-05 23:08:37 -08:00
|
|
|
<v:Avatar Width="16" Height="16"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
IsHitTestVisible="False"
|
2024-03-04 23:53:38 -08:00
|
|
|
User="{Binding StartPoint.Author}"/>
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding StartPoint.Author.Name}" Margin="8,0,0,0"/>
|
2024-05-27 06:05:15 -07:00
|
|
|
<Border Grid.Column="2" Background="DarkGreen" CornerRadius="4" IsVisible="{Binding StartPoint.IsCurrentHead}">
|
|
|
|
<TextBlock Text="HEAD" Classes="monospace" Margin="4,0"/>
|
|
|
|
</Border>
|
|
|
|
<TextBlock Grid.Column="3" Classes="monospace" Text="{Binding StartPoint.SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" PointerPressed="OnPressedSHA"/>
|
|
|
|
<TextBlock Grid.Column="4" Classes="monospace" Text="{Binding StartPoint.CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
|
2024-03-21 21:03:04 -07:00
|
|
|
<TextBlock Grid.Row="1" Classes="monospace" Text="{Binding StartPoint.Subject}" VerticalAlignment="Bottom"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</Border>
|
|
|
|
|
2024-05-27 06:05:15 -07:00
|
|
|
<Path Grid.Column="1" Width="16" Height="16" Fill="{DynamicResource Brush.FG2}" Data="{DynamicResource Icons.Down}" RenderTransformOrigin="50%,50%" RenderTransform="rotate(270deg)"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-05-27 06:05:15 -07:00
|
|
|
<Border Grid.Column="2" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}" CornerRadius="4" Padding="4">
|
|
|
|
<ContentControl Grid.Column="2" Content="{Binding EndPoint}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="m:Commit">
|
|
|
|
<Grid RowDefinitions="Auto,*">
|
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto,Auto">
|
|
|
|
<v:Avatar Width="16" Height="16"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
User="{Binding Author}"/>
|
|
|
|
<TextBlock Grid.Column="1" Classes="monospace" Text="{Binding Author.Name}" Margin="8,0,0,0"/>
|
|
|
|
<Border Grid.Column="2" Background="DarkGreen" CornerRadius="4" IsVisible="{Binding IsCurrentHead}">
|
|
|
|
<TextBlock Text="HEAD" Classes="monospace" Margin="4,0"/>
|
|
|
|
</Border>
|
|
|
|
<TextBlock Grid.Column="3" Classes="monospace" Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" Foreground="DarkOrange" Margin="8,0,0,0" TextDecorations="Underline" PointerPressed="OnPressedSHA" />
|
|
|
|
<TextBlock Grid.Column="4" Classes="monospace" Text="{Binding CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
|
|
|
|
</Grid>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-05-27 06:05:15 -07:00
|
|
|
<TextBlock Grid.Row="1" Classes="monospace" Text="{Binding Subject}" VerticalAlignment="Bottom"/>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="vm:CompareTargetWorktree">
|
2024-05-30 03:08:32 -07:00
|
|
|
<Border HorizontalAlignment="Center" VerticalAlignment="Center" Background="DarkGreen" CornerRadius="4">
|
|
|
|
<TextBlock Text="{DynamicResource Text.Worktree}" Classes="monospace" Margin="4,2"/>
|
|
|
|
</Border>
|
2024-05-27 06:05:15 -07:00
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<Grid Grid.Row="1">
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="256" MinWidth="200" MaxWidth="480"/>
|
2024-03-26 00:18:34 -07:00
|
|
|
<ColumnDefinition Width="4"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
<Grid Grid.Column="0" RowDefinitions="26,*">
|
|
|
|
<!-- Search & Display Mode -->
|
2024-05-28 06:19:53 -07:00
|
|
|
<Grid Grid.Row="0" ColumnDefinitions="*,18">
|
2024-03-11 03:54:12 -07:00
|
|
|
<TextBox Grid.Column="0"
|
|
|
|
Height="26"
|
|
|
|
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
|
|
|
|
Background="Transparent"
|
2024-05-24 20:50:59 -07:00
|
|
|
CornerRadius="4"
|
2024-02-05 23:08:37 -08:00
|
|
|
Watermark="{DynamicResource Text.CommitDetail.Changes.Search}"
|
2024-03-11 03:54:12 -07:00
|
|
|
Text="{Binding SearchFilter, Mode=TwoWay}">
|
|
|
|
<TextBox.InnerLeftContent>
|
|
|
|
<Path Width="14" Height="14" Margin="4,0,0,0" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Search}"/>
|
|
|
|
</TextBox.InnerLeftContent>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
2024-03-11 03:54:12 -07:00
|
|
|
<TextBox.InnerRightContent>
|
|
|
|
<Button Classes="icon_button"
|
|
|
|
IsVisible="{Binding SearchFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
|
|
|
Command="{Binding ClearSearchFilter}">
|
|
|
|
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
|
|
|
</Button>
|
|
|
|
</TextBox.InnerRightContent>
|
|
|
|
</TextBox>
|
|
|
|
|
|
|
|
<v:ChangeViewModeSwitcher Grid.Column="1"
|
2024-05-28 06:19:53 -07:00
|
|
|
Width="14" Height="14"
|
2024-02-05 23:08:37 -08:00
|
|
|
HorizontalAlignment="Right"
|
|
|
|
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode, Mode=TwoWay}"/>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Changes -->
|
|
|
|
<Border Grid.Row="1" Margin="0,4,0,0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}">
|
2024-05-28 06:19:53 -07:00
|
|
|
<v:ChangeCollectionView IsWorkingCopy="False"
|
|
|
|
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode}"
|
|
|
|
Changes="{Binding VisibleChanges}"
|
|
|
|
SelectedChanges="{Binding SelectedChanges, Mode=TwoWay}"
|
2024-05-29 06:56:03 -07:00
|
|
|
ContextRequested="OnChangeContextRequested"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1"
|
2024-03-26 00:18:34 -07:00
|
|
|
MinWidth="1"
|
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
2024-02-05 23:08:37 -08:00
|
|
|
Background="Transparent"/>
|
|
|
|
|
2024-03-26 00:18:34 -07:00
|
|
|
<Grid Grid.Column="2">
|
2024-02-05 23:08:37 -08:00
|
|
|
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
|
|
|
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
|
|
|
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Diff}" Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
<TextBlock Margin="0,16,0,0"
|
|
|
|
Text="{DynamicResource Text.Diff.Welcome}"
|
|
|
|
FontSize="18" FontWeight="Bold"
|
|
|
|
Foreground="{DynamicResource Brush.FG2}"
|
|
|
|
HorizontalAlignment="Center"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<ContentControl Content="{Binding DiffContext}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="vm:DiffContext">
|
|
|
|
<v:DiffView/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|