mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-29 16:14:59 +00:00
Merge branch 'develop' into feature/treedatagrid
# Conflicts: # src/Views/CommitDetail.axaml
This commit is contained in:
commit
179887339e
10 changed files with 95 additions and 15 deletions
|
@ -111,9 +111,6 @@
|
|||
<SelectableTextBlock Text="{Binding FullMessage}" FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}" TextWrapping="Wrap"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
<!-- Line -->
|
||||
<Rectangle Height=".65" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</UserControl.DataTemplates>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
|
||||
|
@ -5,6 +6,15 @@ namespace SourceGit.Views
|
|||
{
|
||||
public partial class CommitBaseInfo : UserControl
|
||||
{
|
||||
public static readonly StyledProperty<bool> CanNavigateProperty =
|
||||
AvaloniaProperty.Register<CommitBaseInfo, bool>(nameof(CanNavigate), true);
|
||||
|
||||
public bool CanNavigate
|
||||
{
|
||||
get => GetValue(CanNavigateProperty);
|
||||
set => SetValue(CanNavigateProperty, value);
|
||||
}
|
||||
|
||||
public CommitBaseInfo()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -12,10 +22,9 @@ namespace SourceGit.Views
|
|||
|
||||
private void OnParentSHAPressed(object sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.CommitDetail detail)
|
||||
{
|
||||
if (DataContext is ViewModels.CommitDetail detail && CanNavigate)
|
||||
detail.NavigateTo((sender as Control).DataContext as string);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,12 +17,15 @@
|
|||
<TextBlock Classes="tab_header" Text="{DynamicResource Text.CommitDetail.Info}"/>
|
||||
</TabItem.Header>
|
||||
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Grid RowDefinitions="Auto,1,*">
|
||||
<!-- Base Information -->
|
||||
<v:CommitBaseInfo Grid.Row="0" Content="{Binding Commit}"/>
|
||||
|
||||
<!-- Line -->
|
||||
<Rectangle Grid.Row="1" Height=".65" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
|
||||
|
||||
<!-- Change List -->
|
||||
<v:ChangeCollectionView Grid.Row="1"
|
||||
<v:ChangeCollectionView Grid.Row="2"
|
||||
Margin="72,0,8,0"
|
||||
IsWorkingCopy="False"
|
||||
ViewMode="List"
|
||||
|
|
|
@ -126,6 +126,44 @@
|
|||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Submodule Diff -->
|
||||
<DataTemplate DataType="m:SubmoduleDiff">
|
||||
<Grid Background="{DynamicResource Brush.Contents}" RowDefinitions="Auto,*">
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{DynamicResource Text.Diff.Submodule}"
|
||||
Margin="8,8,8,8"
|
||||
FontSize="18" FontWeight="Bold"
|
||||
Foreground="{DynamicResource Brush.FG2}"
|
||||
HorizontalAlignment="Center"/>
|
||||
|
||||
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Orientation="Vertical" Margin="8,0">
|
||||
<Border IsVisible="{Binding Old, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<ContentControl Content="{Binding Old}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="m:Commit">
|
||||
<Border Margin="0,0,0,8" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}" Background="{DynamicResource Brush.Window}">
|
||||
<v:CommitBaseInfo MaxHeight="256" Margin="0,0,0,4" CanNavigate="False" Content="{Binding}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
|
||||
<Border Height="16" HorizontalAlignment="Center" Background="Green" CornerRadius="8" IsVisible="{Binding Old, Converter={x:Static ObjectConverters.IsNull}}">
|
||||
<TextBlock Classes="monospace" Text="{DynamicResource Text.Diff.Submodule.New}" Margin="8,0" FontSize="10"/>
|
||||
</Border>
|
||||
|
||||
<Path Width="16" Height="16" Data="{StaticResource Icons.DoubleDown}" HorizontalAlignment="Center" IsVisible="{Binding Old, Converter={x:Static ObjectConverters.IsNotNull}}"/>
|
||||
|
||||
<Border Margin="0,8,0,0" BorderThickness="1" BorderBrush="Green" Background="{DynamicResource Brush.Window}">
|
||||
<v:CommitBaseInfo MaxHeight="256" Margin="0,0,0,4" CanNavigate="False" Content="{Binding New}"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Image Diff -->
|
||||
<DataTemplate DataType="m:ImageDiff">
|
||||
<Grid RowDefinitions="Auto,*,Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,8,8,0">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue