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.CommitBaseInfo">
|
|
|
|
<UserControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="m:Commit">
|
|
|
|
<StackPanel Orientation="Vertical">
|
|
|
|
<!-- Author & Committer -->
|
|
|
|
<Grid ColumnDefinitions="96,*,96,*" Margin="0,8">
|
|
|
|
<!-- Author -->
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:Avatar Grid.Column="0" Width="64" Height="64" HorizontalAlignment="Right" User="{Binding Author}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<StackPanel Grid.Column="1" Margin="16,0,8,0" Orientation="Vertical">
|
|
|
|
<TextBlock Classes="group_header_label" Margin="0" Text="{DynamicResource Text.CommitDetail.Info.Author}"/>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,10,0,8">
|
2024-03-21 21:03:04 -07:00
|
|
|
<SelectableTextBlock Text="{Binding Author.Name}" Margin="2,0,8,0"/>
|
|
|
|
<SelectableTextBlock Text="{Binding Author.Email}" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
2024-03-21 21:03:04 -07:00
|
|
|
<SelectableTextBlock Text="{Binding AuthorTimeStr}"
|
|
|
|
Margin="2,0,0,0"
|
|
|
|
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:FontSizeModifyConverters.Decrease}}"
|
|
|
|
Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
<!-- Committer -->
|
2024-03-04 23:53:38 -08:00
|
|
|
<v:Avatar Grid.Column="2" Width="64" Height="64" HorizontalAlignment="Right" User="{Binding Committer}" IsVisible="{Binding IsCommitterVisible}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
<StackPanel Grid.Column="3" Margin="16,0,8,0" Orientation="Vertical" IsVisible="{Binding IsCommitterVisible}">
|
|
|
|
<TextBlock Classes="group_header_label" Margin="0" Text="{DynamicResource Text.CommitDetail.Info.Committer}"/>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,10,0,8">
|
2024-03-21 21:03:04 -07:00
|
|
|
<SelectableTextBlock Text="{Binding Committer.Name}" Margin="2,0,8,0"/>
|
|
|
|
<SelectableTextBlock Text="{Binding Committer.Email}" Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
2024-03-21 21:03:04 -07:00
|
|
|
<SelectableTextBlock Text="{Binding CommitterTimeStr}"
|
|
|
|
Margin="2,0,0,0"
|
|
|
|
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:FontSizeModifyConverters.Decrease}}"
|
|
|
|
Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Line -->
|
|
|
|
<Rectangle Height=".65" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
|
|
|
|
|
|
|
|
<!-- Base Information -->
|
|
|
|
<Grid RowDefinitions="24,Auto,Auto,Auto" ColumnDefinitions="96,*">
|
|
|
|
<!-- SHA -->
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.SHA}" />
|
2024-03-21 21:03:04 -07:00
|
|
|
<SelectableTextBlock Grid.Row="0" Grid.Column="1" Text="{Binding SHA}" Margin="12,0,0,0" VerticalAlignment="Center" FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- PARENTS -->
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Parents}" IsVisible="{Binding Parents.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}"/>
|
|
|
|
<ItemsControl Grid.Row="1" Grid.Column="1" Height="24" Margin="12,0,0,0" ItemsSource="{Binding Parents}" IsVisible="{Binding Parents.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
2024-03-04 23:53:38 -08:00
|
|
|
<TextBlock Classes="monospace"
|
2024-03-13 01:02:39 -07:00
|
|
|
Text="{Binding Converter={x:Static c:StringConverters.ToShortSHA}}"
|
2024-02-05 23:08:37 -08:00
|
|
|
Foreground="DarkOrange"
|
|
|
|
TextDecorations="Underline"
|
|
|
|
Margin="0,0,16,0"
|
|
|
|
PointerPressed="OnParentSHAPressed"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
|
|
|
|
<!-- REFS -->
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Refs}" IsVisible="{Binding Decorators.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}"/>
|
|
|
|
<ItemsControl Grid.Row="2" Grid.Column="1" Height="24" Margin="12,0,0,0" ItemsSource="{Binding Decorators}" IsVisible="{Binding Decorators.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate DataType="{x:Type m:Decorator}">
|
|
|
|
<Border Height="16" Margin="0,0,6,0" CornerRadius="2" ClipToBounds="True">
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
<Border Background="{DynamicResource Brush.Decorator}" Width="16">
|
|
|
|
<Path Width="8" Height="8" Stretch="Fill" Data="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToIcon}}" Fill="{DynamicResource Brush.DecoratorIcon}"/>
|
|
|
|
</Border>
|
|
|
|
<Border Background="{Binding Type, Converter={x:Static c:DecoratorTypeConverters.ToBackground}}">
|
2024-03-04 23:53:38 -08:00
|
|
|
<TextBlock Classes="monospace" Text="{Binding Name}" FontSize="10" Margin="4,0" Foreground="Black"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
|
|
|
|
<!-- Messages -->
|
|
|
|
<TextBlock Grid.Row="3" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Message}" VerticalAlignment="Top" Margin="0,4,0,0" />
|
2024-04-10 05:13:56 -07:00
|
|
|
<ScrollViewer Grid.Row="3" Grid.Column="1" Margin="12,5,0,0" MaxHeight="64" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
2024-03-21 21:03:04 -07:00
|
|
|
<SelectableTextBlock Text="{Binding FullMessage}" FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}" TextWrapping="Wrap"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</ScrollViewer>
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
<!-- Line -->
|
|
|
|
<Rectangle Height=".65" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</UserControl.DataTemplates>
|
|
|
|
</UserControl>
|