2024-06-13 02:55:22 -07:00
|
|
|
using Avalonia;
|
2024-02-05 23:08:37 -08:00
|
|
|
using Avalonia.Controls;
|
|
|
|
using Avalonia.Input;
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
namespace SourceGit.Views
|
|
|
|
{
|
2024-06-12 20:54:10 -07:00
|
|
|
public partial class FileHistories : ChromelessWindow
|
2024-03-17 18:37:06 -07:00
|
|
|
{
|
|
|
|
public FileHistories()
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
InitializeComponent();
|
|
|
|
}
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
private void MaximizeOrRestoreWindow(object sender, TappedEventArgs e)
|
|
|
|
{
|
2024-06-13 05:26:24 -07:00
|
|
|
_pressedTitleBar = false;
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
if (WindowState == WindowState.Maximized)
|
2024-03-14 03:23:36 -07:00
|
|
|
WindowState = WindowState.Normal;
|
2024-03-17 18:37:06 -07:00
|
|
|
else
|
2024-03-14 03:23:36 -07:00
|
|
|
WindowState = WindowState.Maximized;
|
|
|
|
|
2024-06-12 20:54:10 -07:00
|
|
|
e.Handled = true;
|
2024-03-14 03:23:36 -07:00
|
|
|
}
|
|
|
|
|
2024-03-17 18:37:06 -07:00
|
|
|
private void BeginMoveWindow(object sender, PointerPressedEventArgs e)
|
|
|
|
{
|
2024-06-13 02:55:22 -07:00
|
|
|
if (e.ClickCount != 2)
|
|
|
|
_pressedTitleBar = true;
|
2024-03-14 03:23:36 -07:00
|
|
|
}
|
2024-06-13 02:55:22 -07:00
|
|
|
|
|
|
|
private void MoveWindow(object sender, PointerEventArgs e)
|
|
|
|
{
|
|
|
|
if (!_pressedTitleBar)
|
|
|
|
return;
|
|
|
|
|
|
|
|
var visual = (Visual)e.Source;
|
|
|
|
BeginMoveDrag(new PointerPressedEventArgs(
|
|
|
|
e.Source,
|
|
|
|
e.Pointer,
|
|
|
|
visual,
|
|
|
|
e.GetPosition(visual),
|
|
|
|
e.Timestamp,
|
|
|
|
new PointerPointProperties(RawInputModifiers.None, PointerUpdateKind.LeftButtonPressed),
|
|
|
|
e.KeyModifiers));
|
|
|
|
}
|
|
|
|
|
|
|
|
private void EndMoveWindow(object sender, PointerReleasedEventArgs e)
|
|
|
|
{
|
|
|
|
_pressedTitleBar = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private bool _pressedTitleBar = false;
|
2024-02-05 23:08:37 -08:00
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
}
|