mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 21:24:59 +00:00
code_review: PR #431
* move resources and styles for macOS caption button to `CaptionButtonsMacOS` because it is never used by others and should not been changed * add `IsCloseButtonOnly` property to `CaptionButtons` and `CaptionButtonsMacOS` and replace the controls in windows
This commit is contained in:
parent
e3ee07be70
commit
e19d025572
25 changed files with 269 additions and 339 deletions
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Avalonia.Input;
|
||||
|
@ -33,22 +34,25 @@ namespace SourceGit.Views
|
|||
}
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
App.Quit(_exitCode);
|
||||
}
|
||||
|
||||
private void BeginMoveWindow(object _, PointerPressedEventArgs e)
|
||||
{
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
private void CloseWindow(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
App.Quit(-1);
|
||||
}
|
||||
|
||||
private void SaveAndClose(object _1, RoutedEventArgs _2)
|
||||
{
|
||||
File.WriteAllText(_file, Editor.Text);
|
||||
App.Quit(0);
|
||||
_exitCode = 0;
|
||||
Close();
|
||||
}
|
||||
|
||||
private readonly string _file;
|
||||
private int _exitCode = -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue