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"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
|
x:Class="SourceGit.Views.RevisionFiles"
|
|
|
|
x:DataType="vm:CommitDetail">
|
|
|
|
<Grid>
|
|
|
|
<Grid.ColumnDefinitions>
|
2024-06-11 01:36:52 -07:00
|
|
|
<ColumnDefinition Width="{Binding Source={x:Static vm:Preference.Instance}, Path=Layout.CommitDetailFilesLeftWidth, Mode=TwoWay}" 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>
|
|
|
|
|
2024-06-07 01:32:06 -07:00
|
|
|
<!-- File Tree -->
|
|
|
|
<Border Grid.Column="0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}">
|
2024-07-11 22:54:13 -07:00
|
|
|
<v:RevisionFileTreeView Revision="{Binding Commit.SHA}"/>
|
2024-06-07 01:32:06 -07:00
|
|
|
</Border>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<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"/>
|
|
|
|
|
|
|
|
<!-- File Content Viewer -->
|
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}">
|
|
|
|
<ContentControl Content="{Binding ViewRevisionFileContent}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="m:RevisionBinaryFile">
|
|
|
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Error}" Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
<TextBlock Margin="0,16,0,0" Text="{DynamicResource Text.BinaryNotSupported}" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-03-13 20:59:56 -07:00
|
|
|
<StackPanel Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
|
|
|
|
<TextBlock Classes="monospace" Text="{Binding Size}" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
<TextBlock Text="{DynamicResource Text.Bytes}" Margin="8,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</StackPanel>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="m:RevisionTextFile">
|
2024-03-21 21:03:04 -07:00
|
|
|
<v:RevisionTextFileView FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}" Background="{DynamicResource Brush.Contents}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
|
2024-03-27 06:38:38 -07:00
|
|
|
<DataTemplate DataType="m:RevisionImageFile">
|
2024-06-22 03:56:49 -07:00
|
|
|
<Border Margin="0,8" VerticalAlignment="Center" HorizontalAlignment="Center" Effect="drop-shadow(0 0 8 #A0000000)">
|
|
|
|
<Border Background="{DynamicResource Brush.Window}">
|
|
|
|
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}" Margin="8">
|
|
|
|
<Grid>
|
|
|
|
<v:ImageContainer/>
|
|
|
|
<Image Source="{Binding Image}" Stretch="Uniform" VerticalAlignment="Center" RenderOptions.BitmapInterpolationMode="HighQuality"/>
|
|
|
|
</Grid>
|
|
|
|
</Border>
|
2024-03-28 02:20:19 -07:00
|
|
|
</Border>
|
|
|
|
</Border>
|
2024-03-27 06:38:38 -07:00
|
|
|
</DataTemplate>
|
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
<DataTemplate DataType="m:RevisionLFSObject">
|
|
|
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
|
<TextBlock Text="{DynamicResource Text.CommitDetail.Files.LFS}" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
<Path Width="64" Height="64" Margin="0,24,0,0" Data="{StaticResource Icons.LFS}" Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
<SelectableTextBlock Margin="0,16,0,0" Text="{Binding Object.Oid}" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
<StackPanel Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
|
2024-03-04 23:53:38 -08:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Object.Size}" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<TextBlock Text="{DynamicResource Text.Bytes}" Margin="8,0,0,0" Foreground="{DynamicResource Brush.FG2}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="m:RevisionSubmodule">
|
2024-06-18 23:24:49 -07:00
|
|
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Margin="8,8,8,0">
|
2024-02-05 23:08:37 -08:00
|
|
|
<TextBlock Text="{DynamicResource Text.CommitDetail.Files.Submodule}" FontSize="18" FontWeight="Bold" HorizontalAlignment="Center" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-06-18 23:24:49 -07:00
|
|
|
<v:CommitBaseInfo Margin="0,16,0,0" CanNavigate="False" Content="{Binding Commit}" Message="{Binding FullMessage}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</Grid>
|
|
|
|
</UserControl>
|