|
| 1 | +<UserControl xmlns="https://github.com/avaloniaui" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 4 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | + xmlns:m="using:SourceGit.Models" |
| 6 | + xmlns:v="using:SourceGit.Views" |
| 7 | + xmlns:vm="using:SourceGit.ViewModels" |
| 8 | + xmlns:c="using:SourceGit.Converters" |
| 9 | + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
| 10 | + x:Class="SourceGit.Views.Conflict" |
| 11 | + x:DataType="vm:Conflict"> |
| 12 | + <Border Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"> |
| 13 | + <Grid VerticalAlignment="Center"> |
| 14 | + <StackPanel Orientation="Vertical" IsVisible="{Binding !IsResolved}"> |
| 15 | + <StackPanel.DataTemplates> |
| 16 | + <DataTemplate DataType="vm:ConflictSourceBranch"> |
| 17 | + <StackPanel Orientation="Horizontal"> |
| 18 | + <Path Width="12" Height="12" Data="{StaticResource Icons.Branch}"/> |
| 19 | + <TextBlock Margin="4,0,0,0" Text="{Binding Name}"/> |
| 20 | + <TextBlock Margin="4,0,0,0" |
| 21 | + Text="{Binding Head, Converter={x:Static c:StringConverters.ToShortSHA}}" |
| 22 | + Foreground="DarkOrange" |
| 23 | + TextDecorations="Underline" |
| 24 | + Cursor="Hand" |
| 25 | + PointerPressed="OnPressedSHA" |
| 26 | + ToolTip.Tip="{Binding Revision}" |
| 27 | + ToolTip.ShowDelay="0"> |
| 28 | + <TextBlock.DataTemplates> |
| 29 | + <DataTemplate DataType="m:Commit"> |
| 30 | + <StackPanel MinWidth="400" Orientation="Vertical"> |
| 31 | + <Grid ColumnDefinitions="Auto,*,Auto"> |
| 32 | + <v:Avatar Grid.Column="0" Width="16" Height="16" VerticalAlignment="Center" IsHitTestVisible="False" User="{Binding Author}"/> |
| 33 | + <TextBlock Grid.Column="1" Classes="primary" Text="{Binding Author.Name}" Margin="8,0,0,0"/> |
| 34 | + <TextBlock Grid.Column="2" Classes="primary" Text="{Binding CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/> |
| 35 | + </Grid> |
| 36 | + |
| 37 | + <TextBlock Classes="primary" Margin="0,8,0,0" Text="{Binding Subject}" TextWrapping="Wrap"/> |
| 38 | + </StackPanel> |
| 39 | + </DataTemplate> |
| 40 | + </TextBlock.DataTemplates> |
| 41 | + </TextBlock> |
| 42 | + </StackPanel> |
| 43 | + </DataTemplate> |
| 44 | + |
| 45 | + <DataTemplate DataType="m:Commit"> |
| 46 | + <StackPanel Orientation="Horizontal"> |
| 47 | + <Path Width="12" Height="12" Data="{StaticResource Icons.Commit}"/> |
| 48 | + <v:CommitRefsPresenter Margin="8,0,0,0" |
| 49 | + TagBackground="{DynamicResource Brush.DecoratorTag}" |
| 50 | + Foreground="{DynamicResource Brush.FG1}" |
| 51 | + FontFamily="{DynamicResource Fonts.Primary}" |
| 52 | + FontSize="11" |
| 53 | + VerticalAlignment="Center" |
| 54 | + UseGraphColor="False"/> |
| 55 | + <TextBlock Margin="4,0,0,0" |
| 56 | + Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}" |
| 57 | + Foreground="DarkOrange" |
| 58 | + TextDecorations="Underline" |
| 59 | + Cursor="Hand" |
| 60 | + PointerPressed="OnPressedSHA" |
| 61 | + ToolTip.Tip="{Binding}" |
| 62 | + ToolTip.ShowDelay="0"> |
| 63 | + <TextBlock.DataTemplates> |
| 64 | + <DataTemplate DataType="m:Commit"> |
| 65 | + <StackPanel MinWidth="400" Orientation="Vertical"> |
| 66 | + <Grid ColumnDefinitions="Auto,*,Auto"> |
| 67 | + <v:Avatar Grid.Column="0" Width="16" Height="16" VerticalAlignment="Center" IsHitTestVisible="False" User="{Binding Author}"/> |
| 68 | + <TextBlock Grid.Column="1" Classes="primary" Text="{Binding Author.Name}" Margin="8,0,0,0"/> |
| 69 | + <TextBlock Grid.Column="2" Classes="primary" Text="{Binding CommitterTimeStr}" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/> |
| 70 | + </Grid> |
| 71 | + |
| 72 | + <TextBlock Classes="primary" Margin="0,8,0,0" Text="{Binding Subject}" TextWrapping="Wrap"/> |
| 73 | + </StackPanel> |
| 74 | + </DataTemplate> |
| 75 | + </TextBlock.DataTemplates> |
| 76 | + </TextBlock> |
| 77 | + <TextBlock Margin="4,0,0,0" Text="{Binding Subject}"/> |
| 78 | + </StackPanel> |
| 79 | + </DataTemplate> |
| 80 | + |
| 81 | + <DataTemplate DataType="x:String"> |
| 82 | + <StackPanel Orientation="Horizontal"> |
| 83 | + <Path Width="12" Height="12" Data="{StaticResource Icons.Changes}"/> |
| 84 | + <TextBlock Margin="4,0,0,0" Text="{Binding}"/> |
| 85 | + </StackPanel> |
| 86 | + </DataTemplate> |
| 87 | + </StackPanel.DataTemplates> |
| 88 | + |
| 89 | + <Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/> |
| 90 | + <TextBlock Margin="0,16" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/> |
| 91 | + |
| 92 | + <Border Margin="16,0" Padding="8" CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"> |
| 93 | + <Border.IsVisible> |
| 94 | + <MultiBinding Converter="{x:Static BoolConverters.And}"> |
| 95 | + <Binding Path="Theirs" Converter="{x:Static ObjectConverters.IsNotNull}"/> |
| 96 | + <Binding Path="Mine" Converter="{x:Static ObjectConverters.IsNotNull}"/> |
| 97 | + </MultiBinding> |
| 98 | + </Border.IsVisible> |
| 99 | + |
| 100 | + <Grid Margin="8,0,0,0" RowDefinitions="32,32" ColumnDefinitions="Auto,*"> |
| 101 | + <TextBlock Grid.Row="0" Grid.Column="0" Classes="info_label" Text="THEIRS"/> |
| 102 | + <ContentControl Grid.Row="0" Grid.Column="1" Margin="16,0,0,0" Content="{Binding Theirs}"/> |
| 103 | + <TextBlock Grid.Row="1" Grid.Column="0" Classes="info_label" Text="MINE"/> |
| 104 | + <ContentControl Grid.Row="1" Grid.Column="1" Margin="16,0,0,0" Content="{Binding Mine}"/> |
| 105 | + </Grid> |
| 106 | + </Border> |
| 107 | + |
| 108 | + <StackPanel Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center"> |
| 109 | + <Button Classes="flat" Content="USE THEIRS" Command="{Binding UseTheirs}"/> |
| 110 | + <Button Classes="flat" Margin="8,0,0,0" Content="USE MINE" Command="{Binding UseMine}"/> |
| 111 | + <Button Classes="flat" Margin="8,0,0,0" Content="OPEN EXTERNAL MERGETOOL" Command="{Binding OpenExternalMergeTool}"/> |
| 112 | + </StackPanel> |
| 113 | + </StackPanel> |
| 114 | + |
| 115 | + <StackPanel Orientation="Vertical" IsVisible="{Binding IsResolved}"> |
| 116 | + <Path Width="64" Height="64" Data="{StaticResource Icons.Check}" Fill="Green"/> |
| 117 | + <TextBlock Margin="0,16,0,8" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts.Resolved}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/> |
| 118 | + <TextBlock Text="{DynamicResource Text.WorkingCopy.CanStageTip}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/> |
| 119 | + </StackPanel> |
| 120 | + </Grid> |
| 121 | + </Border> |
| 122 | +</UserControl> |
0 commit comments