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"
|
2024-06-07 21:19:48 -07:00
|
|
|
x:Class="SourceGit.Views.CommitBaseInfo"
|
|
|
|
x:Name="ThisControl">
|
2024-02-05 23:08:37 -08:00
|
|
|
<UserControl.DataTemplates>
|
|
|
|
<DataTemplate DataType="m:Commit">
|
|
|
|
<StackPanel Orientation="Vertical">
|
|
|
|
<!-- Author & Committer -->
|
2024-05-30 00:13:59 -07:00
|
|
|
<UniformGrid Rows="1" Margin="0,8">
|
2024-02-05 23:08:37 -08:00
|
|
|
<!-- Author -->
|
2024-06-07 21:19:48 -07:00
|
|
|
<Grid ColumnDefinitions="96,*">
|
2024-04-30 06:50:30 -07:00
|
|
|
<v:Avatar Grid.Column="0" Width="64" Height="64" HorizontalAlignment="Right" User="{Binding Author}"/>
|
|
|
|
<StackPanel Grid.Column="1" Margin="16,0,8,0" Orientation="Vertical">
|
|
|
|
<TextBlock Classes="group_header_label" Margin="0" Text="{DynamicResource Text.CommitDetail.Info.Author}"/>
|
|
|
|
<DockPanel Margin="0,10,0,8" ClipToBounds="True">
|
|
|
|
<SelectableTextBlock Text="{Binding Author.Name}" Margin="2,0,8,0"/>
|
|
|
|
<SelectableTextBlock Text="{Binding Author.Email}" ToolTip.Tip="{Binding Author.Email}" Foreground="{DynamicResource Brush.FG2}" TextTrimming="CharacterEllipsis"/>
|
|
|
|
</DockPanel>
|
2024-05-30 00:13:59 -07:00
|
|
|
<SelectableTextBlock Text="{Binding AuthorTimeStr}"
|
2024-04-30 06:50:30 -07:00
|
|
|
Margin="2,0,0,0"
|
2024-06-21 02:48:19 -07:00
|
|
|
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Decrease}}"
|
2024-04-30 06:50:30 -07:00
|
|
|
Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
2024-04-30 06:50:30 -07:00
|
|
|
</Grid>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- Committer -->
|
2024-06-07 21:19:48 -07:00
|
|
|
<Grid ColumnDefinitions="96,*" IsVisible="{Binding IsCommitterVisible}">
|
2024-04-30 06:50:30 -07:00
|
|
|
<v:Avatar Grid.Column="0" Width="64" Height="64" HorizontalAlignment="Right" User="{Binding Committer}"/>
|
|
|
|
<StackPanel Grid.Column="1" Margin="16,0,8,0" Orientation="Vertical">
|
|
|
|
<TextBlock Classes="group_header_label" Margin="0" Text="{DynamicResource Text.CommitDetail.Info.Committer}"/>
|
|
|
|
<DockPanel Margin="0,10,0,8" ClipToBounds="True">
|
|
|
|
<SelectableTextBlock Text="{Binding Committer.Name}" Margin="2,0,8,0"/>
|
|
|
|
<SelectableTextBlock Text="{Binding Committer.Email}" ToolTip.Tip="{Binding Committer.Email}" Foreground="{DynamicResource Brush.FG2}" TextTrimming="CharacterEllipsis"/>
|
|
|
|
</DockPanel>
|
2024-05-30 00:13:59 -07:00
|
|
|
<SelectableTextBlock Text="{Binding CommitterTimeStr}"
|
|
|
|
Margin="2,0,0,0"
|
2024-06-21 02:48:19 -07:00
|
|
|
FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Decrease}}"
|
2024-04-30 06:50:30 -07:00
|
|
|
Foreground="{DynamicResource Brush.FG2}"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</StackPanel>
|
2024-04-30 06:50:30 -07:00
|
|
|
</Grid>
|
2024-05-30 00:13:59 -07:00
|
|
|
</UniformGrid>
|
2024-02-05 23:08:37 -08:00
|
|
|
|
|
|
|
<!-- 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-08-13 02:15:17 -07:00
|
|
|
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
|
|
|
<SelectableTextBlock Classes="primary"
|
|
|
|
Text="{Binding SHA}"
|
|
|
|
Margin="12,0,0,0"
|
|
|
|
VerticalAlignment="Center"/>
|
|
|
|
|
2024-08-13 20:14:21 -07:00
|
|
|
<Button Classes="icon_button" Cursor="Hand" Click="OnOpenWebLink" IsVisible="{Binding #ThisControl.WebLinks, Converter={x:Static c:ListConverters.IsNotNullOrEmpty}}">
|
2024-08-13 02:15:17 -07:00
|
|
|
<Path Width="12" Height="12" Data="{StaticResource Icons.Link}" Fill="{DynamicResource Brush.Link}"/>
|
|
|
|
</Button>
|
|
|
|
</StackPanel>
|
|
|
|
|
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-07-29 05:48:04 -07:00
|
|
|
<TextBlock Classes="primary"
|
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"
|
2024-08-14 02:27:37 -07:00
|
|
|
Cursor="Hand"
|
2024-02-05 23:08:37 -08:00
|
|
|
Margin="0,0,16,0"
|
|
|
|
PointerPressed="OnParentSHAPressed"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
|
|
|
|
<!-- REFS -->
|
2024-07-25 00:31:16 -07:00
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Refs}" IsVisible="{Binding HasDecorators}"/>
|
|
|
|
<Border Grid.Row="2" Grid.Column="1" Margin="12,0,0,0" Height="24" IsVisible="{Binding HasDecorators}">
|
|
|
|
<v:CommitRefsPresenter IconBackground="{DynamicResource Brush.DecoratorIconBG}"
|
|
|
|
IconForeground="{DynamicResource Brush.DecoratorIcon}"
|
|
|
|
BranchNameBackground="{DynamicResource Brush.DecoratorBranch}"
|
|
|
|
TagNameBackground="{DynamicResource Brush.DecoratorTag}"
|
|
|
|
LabelForeground="{DynamicResource Brush.DecoratorFG}"
|
|
|
|
FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}"
|
|
|
|
FontSize="10"
|
|
|
|
VerticalAlignment="Center"/>
|
|
|
|
</Border>
|
|
|
|
|
2024-02-05 23:08:37 -08:00
|
|
|
<!-- 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-08-05 02:34:49 -07:00
|
|
|
<v:CommitMessagePresenter Grid.Row="3" Grid.Column="1"
|
|
|
|
Margin="12,5,8,0"
|
|
|
|
Classes="primary"
|
|
|
|
Message="{Binding #ThisControl.Message}"
|
2024-08-05 03:18:57 -07:00
|
|
|
IssueTrackerRules="{Binding #ThisControl.IssueTrackerRules}"
|
2024-08-05 02:34:49 -07:00
|
|
|
TextWrapping="Wrap"/>
|
2024-02-05 23:08:37 -08:00
|
|
|
</Grid>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</UserControl.DataTemplates>
|
|
|
|
</UserControl>
|