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.Histories"
|
|
|
|
x:DataType="vm:Histories">
|
2024-03-26 00:18:34 -07:00
|
|
|
<v:LayoutableGrid RowDefinitions="*,3,*" ColumnDefinitions="*,3,*"
|
2024-02-05 23:08:37 -08:00
|
|
|
UseHorizontal="{Binding Source={x:Static vm:Preference.Instance}, Path=UseTwoColumnsLayoutInHistories}">
|
|
|
|
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
|
|
|
|
<DataGrid x:Name="commitDataGrid"
|
2024-02-18 23:30:10 -08:00
|
|
|
Background="{DynamicResource Brush.Contents}"
|
|
|
|
ItemsSource="{Binding Commits}"
|
|
|
|
SelectionMode="Extended"
|
|
|
|
SelectedItem="{Binding AutoSelectedCommit, Mode=OneWay}"
|
|
|
|
CanUserReorderColumns="False"
|
|
|
|
CanUserResizeColumns="False"
|
|
|
|
CanUserSortColumns="False"
|
|
|
|
IsReadOnly="True"
|
|
|
|
HeadersVisibility="None"
|
|
|
|
Focusable="False"
|
|
|
|
RowHeight="{Binding DataGridRowHeight}"
|
|
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
LayoutUpdated="OnCommitDataGridLayoutUpdated"
|
|
|
|
SelectionChanged="OnCommitDataGridSelectionChanged"
|
|
|
|
ContextRequested="OnCommitDataGridContextRequested">
|
2024-02-05 23:08:37 -08:00
|
|
|
<DataGrid.Columns>
|
|
|
|
<DataGridTemplateColumn Width="*" Header="GRAPH">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Commit}">
|
|
|
|
<Border Margin="{Binding Margin}">
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="2,0,0,0">
|
|
|
|
<ItemsControl ItemsSource="{Binding Decorators}" IsVisible="{Binding HasDecorators}">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<WrapPanel Orientation="Horizontal" VerticalAlignment="Center"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate DataType="{x:Type m:Decorator}">
|
|
|
|
<Border Height="16" Margin="0,0,4,0" CornerRadius="2" ClipToBounds="True">
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<Border Background="{DynamicResource Brush.Decorator}" Width="16">
|
2024-03-24 19:27:07 -07:00
|
|
|
<Path Width="8" Height="8"
|
|
|
|
Stretch="Uniform"
|
|
|
|
Data="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToIcon}}"
|
|
|
|
Fill="{DynamicResource Brush.DecoratorIcon}"
|
|
|
|
VerticalAlignment="Center"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
<Border Background="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToBackground}}">
|
2024-04-02 05:42:17 -07:00
|
|
|
<TextBlock Classes="monospace"
|
|
|
|
Text="{Binding Name}"
|
|
|
|
FontSize="10"
|
|
|
|
Margin="4,0"
|
|
|
|
Foreground="Black"
|
|
|
|
FontWeight="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToFontWeight}}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
|
2024-04-01 03:11:22 -07:00
|
|
|
<TextBlock Classes="monospace"
|
|
|
|
Text="{Binding Subject}"
|
|
|
|
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
|
|
|
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="AVATAR">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Commit}">
|
|
|
|
<v:Avatar Width="16" Height="16"
|
|
|
|
Margin="16,0,8,0"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
User="{Binding Author}"
|
|
|
|
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn MaxWidth="100" Header="AUTHOR">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Commit}">
|
2024-03-04 23:53:38 -08:00
|
|
|
<TextBlock Classes="monospace"
|
|
|
|
Text="{Binding Author.Name}"
|
2024-02-05 23:08:37 -08:00
|
|
|
Margin="0,0,8,0"
|
2024-04-01 03:11:22 -07:00
|
|
|
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
|
|
|
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="SHA">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Commit}">
|
2024-03-04 23:53:38 -08:00
|
|
|
<TextBlock Classes="monospace"
|
|
|
|
Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
|
2024-02-05 23:08:37 -08:00
|
|
|
Margin="12,0"
|
2024-04-01 03:11:22 -07:00
|
|
|
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
|
|
|
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
|
|
|
|
<DataGridTemplateColumn Header="TIME">
|
|
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
|
|
<DataTemplate x:DataType="{x:Type m:Commit}">
|
2024-03-04 23:53:38 -08:00
|
|
|
<TextBlock Classes="monospace"
|
|
|
|
Text="{Binding CommitterTimeStr}"
|
2024-02-05 23:08:37 -08:00
|
|
|
Margin="8,0"
|
2024-04-01 03:11:22 -07:00
|
|
|
Opacity="{Binding IsMerged, Converter={x:Static c:BoolConverters.ToCommitOpacity}}"
|
|
|
|
FontWeight="{Binding IsCurrentHead, Converter={x:Static c:BoolConverters.ToCommitFontWeight}}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</DataTemplate>
|
|
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
|
|
</DataGridTemplateColumn>
|
|
|
|
</DataGrid.Columns>
|
|
|
|
</DataGrid>
|
|
|
|
|
|
|
|
<v:CommitGraph x:Name="commitGraph"
|
|
|
|
BindingDataGrid="{Binding #commitDataGrid}"
|
|
|
|
Graph="{Binding Graph}"
|
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
ClipToBounds="True"/>
|
|
|
|
|
|
|
|
<Path Classes="rotating"
|
|
|
|
Width="48" Height="48"
|
|
|
|
Data="{DynamicResource Icons.Loading}"
|
|
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
IsVisible="{Binding IsLoading}"/>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<GridSplitter Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
|
|
|
|
MinWidth="1" MinHeight="1"
|
2024-02-18 23:30:10 -08:00
|
|
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
2024-03-26 00:18:34 -07:00
|
|
|
Background="{DynamicResource Brush.Window}"
|
|
|
|
BorderBrush="{DynamicResource Brush.Border0}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3">
|
|
|
|
<Border Background="{DynamicResource Brush.Window}">
|
|
|
|
<Path Width="128" Height="128"
|
|
|
|
Data="{StaticResource Icons.Detail}"
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
<ContentControl Content="{Binding DetailContext}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="vm:CommitDetail">
|
|
|
|
<v:CommitDetail/>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="vm:RevisionCompare">
|
|
|
|
<v:RevisionCompare/>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate DataType="vm:CountSelectedCommits">
|
|
|
|
<Grid Background="{DynamicResource Brush.Window}">
|
|
|
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
|
<Path Width="128" Height="128"
|
|
|
|
Data="{StaticResource Icons.Detail}"
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
Fill="{DynamicResource Brush.FG2}"/>
|
|
|
|
|
|
|
|
<TextBlock HorizontalAlignment="Center"
|
|
|
|
Margin="0,16"
|
|
|
|
FontSize="24" FontWeight="Bold"
|
|
|
|
Foreground="{DynamicResource Brush.FG2}"
|
|
|
|
Text="{Binding Count, Converter={x:Static c:StringConverters.FormatByResourceKey}, ConverterParameter='Histories.Selected'}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ContentControl.DataTemplates>
|
|
|
|
</ContentControl>
|
|
|
|
</Grid>
|
|
|
|
</v:LayoutableGrid>
|
|
|
|
</UserControl>
|