mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-21 18:35:00 +00:00
Split line counters in a new view
This commit is contained in:
parent
f1fcdb89f3
commit
2cac661676
3 changed files with 61 additions and 21 deletions
|
@ -183,27 +183,8 @@
|
|||
|
||||
<!-- Stats -->
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Classes="info_label" VerticalAlignment="Top" Margin="0,4,0,0" Text="{DynamicResource Text.CommitDetail.Info.Stats}" />
|
||||
<!--v:LinesChanged Grid.Row="4" Grid.Column="1" AddedCount="{Binding AddedLines}" RemovedCount="{Binding RemovedLines}" /-->
|
||||
<StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" Height="24">
|
||||
<Border Margin="12,0,4,0" VerticalAlignment="Center" BorderBrush="Green" BorderThickness="1" CornerRadius="6">
|
||||
<TextBlock VerticalAlignment="Center" Foreground="Green" Padding="3,0">
|
||||
<TextBlock.Inlines>
|
||||
<Run Text="+"/>
|
||||
<Run Text="{Binding AddedLines}"/>
|
||||
</TextBlock.Inlines>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
|
||||
<Border Margin="12,0,4,0" VerticalAlignment="Center" BorderBrush="Red" BorderThickness="1" CornerRadius="6">
|
||||
<TextBlock VerticalAlignment="Center" Foreground="Red" Padding="3,0">
|
||||
<TextBlock.Inlines>
|
||||
<Run Text="-"/>
|
||||
<Run Text="{Binding RemovedLines}"/>
|
||||
</TextBlock.Inlines>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<v:LinesChanged Grid.Row="4" Grid.Column="1" AddedCount="{Binding AddedLines}" RemovedCount="{Binding RemovedLines}" />
|
||||
|
||||
<!-- Messages -->
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Classes="info_label" VerticalAlignment="Top" Margin="0,4,0,0" Text="{DynamicResource Text.CommitDetail.Info.Message}" />
|
||||
<v:CommitMessagePresenter Grid.Row="5" Grid.Column="1"
|
||||
|
|
28
src/Views/LinesChanged.axaml
Normal file
28
src/Views/LinesChanged.axaml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<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"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.LinesChanged"
|
||||
x:Name="ThisControl"
|
||||
Height="24">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border Margin="12,0,4,0" VerticalAlignment="Center" BorderBrush="Green" BorderThickness="1" CornerRadius="6">
|
||||
<TextBlock VerticalAlignment="Center" Foreground="Green" Padding="3,0">
|
||||
<TextBlock.Inlines>
|
||||
<Run Text="+"/>
|
||||
<Run Text="{Binding #ThisControl.AddedCount}"/>
|
||||
</TextBlock.Inlines>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
|
||||
<Border Margin="12,0,4,0" VerticalAlignment="Center" BorderBrush="Red" BorderThickness="1" CornerRadius="6">
|
||||
<TextBlock VerticalAlignment="Center" Foreground="Red" Padding="3,0">
|
||||
<TextBlock.Inlines>
|
||||
<Run Text="-"/>
|
||||
<Run Text="{Binding #ThisControl.RemovedCount}"/>
|
||||
</TextBlock.Inlines>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</UserControl>
|
31
src/Views/LinesChanged.axaml.cs
Normal file
31
src/Views/LinesChanged.axaml.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class LinesChanged : UserControl
|
||||
{
|
||||
public static readonly StyledProperty<int> AddedCountProperty =
|
||||
AvaloniaProperty.Register<LinesChanged, int>(nameof(AddedCount));
|
||||
|
||||
public static readonly StyledProperty<int> RemovedCountProperty =
|
||||
AvaloniaProperty.Register<LinesChanged, int>(nameof(RemovedCount));
|
||||
|
||||
public int AddedCount
|
||||
{
|
||||
get => GetValue(AddedCountProperty);
|
||||
set => SetValue(AddedCountProperty, value);
|
||||
}
|
||||
|
||||
public int RemovedCount
|
||||
{
|
||||
get => GetValue(RemovedCountProperty);
|
||||
set => SetValue(RemovedCountProperty, value);
|
||||
}
|
||||
|
||||
public LinesChanged()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue