mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 08:34:59 +00:00
feature: allow empty commit (#587)
This commit is contained in:
parent
a8a7775b83
commit
1855b43750
8 changed files with 147 additions and 20 deletions
74
src/Views/ConfirmCommitWithoutFiles.axaml
Normal file
74
src/Views/ConfirmCommitWithoutFiles.axaml
Normal file
|
@ -0,0 +1,74 @@
|
|||
<v:ChromelessWindow 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:v="using:SourceGit.Views"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.ConfirmCommitWithoutFiles"
|
||||
x:DataType="vm:ConfirmCommitWithoutFiles"
|
||||
x:Name="ThisControl"
|
||||
Icon="/App.ico"
|
||||
Title="{DynamicResource Text.Warn}"
|
||||
SizeToContent="WidthAndHeight"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||
<!-- TitleBar -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="{DynamicResource Brush.TitleBar}"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
||||
PointerPressed="BeginMoveWindow"/>
|
||||
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Data="{StaticResource Icons.Error}"
|
||||
Margin="10,0,0,0"
|
||||
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||
|
||||
<v:CaptionButtonsMacOS Grid.Column="0"
|
||||
Margin="0,2,0,0"
|
||||
IsCloseButtonOnly="True"
|
||||
IsVisible="{OnPlatform False, macOS=True}"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.Warn}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsHitTestVisible="False"/>
|
||||
|
||||
<v:CaptionButtons Grid.Column="2"
|
||||
IsCloseButtonOnly="True"
|
||||
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Body -->
|
||||
<Border Grid.Row="1" Margin="16">
|
||||
<TextBlock Text="{DynamicResource Text.WorkingCopy.ConfirmCommitWithoutFiles}"/>
|
||||
</Border>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="2" Margin="0,0,0,16" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Classes="flat"
|
||||
Width="80"
|
||||
Height="30"
|
||||
Margin="4,0"
|
||||
Click="Sure"
|
||||
Content="{DynamicResource Text.Sure}"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"/>
|
||||
|
||||
<Button Classes="flat primary"
|
||||
Width="80"
|
||||
Height="30"
|
||||
Margin="4,0"
|
||||
Click="CloseWindow"
|
||||
Content="{DynamicResource Text.Cancel}"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</v:ChromelessWindow>
|
33
src/Views/ConfirmCommitWithoutFiles.axaml.cs
Normal file
33
src/Views/ConfirmCommitWithoutFiles.axaml.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class ConfirmCommitWithoutFiles : ChromelessWindow
|
||||
{
|
||||
public ConfirmCommitWithoutFiles()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BeginMoveWindow(object _, PointerPressedEventArgs e)
|
||||
{
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
private void Sure(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
if (DataContext is ViewModels.ConfirmCommitWithoutFiles vm)
|
||||
{
|
||||
vm.Continue();
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CloseWindow(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
SizeToContent="Height"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto" MinWidth="494">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||
<!-- TitleBar -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue