mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 05:10:25 +08:00
revert: "refactor: commit message editor (#2096)"
This reverts commit ceea4a18fc.
This commit is contained in:
@@ -37,10 +37,12 @@
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="8">
|
||||
<v:CommitMessageToolBox x:Name="Editor" Height="400"/>
|
||||
<Button Width="0" Height="0"
|
||||
Margin="0" Padding="0"
|
||||
Click="OnCloseByHotKey"
|
||||
HotKey="Escape"/>
|
||||
<Button Classes="flat primary"
|
||||
Width="80"
|
||||
Margin="0,8,0,4"
|
||||
Content="{DynamicResource Text.Sure}"
|
||||
Click="SaveAndClose"
|
||||
HorizontalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</v:ChromelessWindow>
|
||||
|
||||
@@ -60,18 +60,19 @@ namespace SourceGit.Views
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
_onSave?.Invoke(Editor.CommitMessage);
|
||||
|
||||
if (_shouldExitApp)
|
||||
App.Quit(0);
|
||||
App.Quit(_exitCode);
|
||||
}
|
||||
|
||||
private void OnCloseByHotKey(object sender, RoutedEventArgs e)
|
||||
private void SaveAndClose(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
_onSave?.Invoke(Editor.CommitMessage);
|
||||
_exitCode = 0;
|
||||
Close();
|
||||
}
|
||||
|
||||
private Action<string> _onSave = null;
|
||||
private bool _shouldExitApp = true;
|
||||
private int _exitCode = -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user