2024-02-05 23:08:37 -08:00
|
|
|
using Avalonia.Controls;
|
|
|
|
using Avalonia.Input;
|
2024-08-23 21:06:38 -07:00
|
|
|
using Avalonia.Interactivity;
|
2024-02-05 23:08:37 -08:00
|
|
|
|
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-07-14 00:55:15 -07:00
|
|
|
private void MaximizeOrRestoreWindow(object _, TappedEventArgs e)
|
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-07-14 00:55:15 -07:00
|
|
|
private void BeginMoveWindow(object _, PointerPressedEventArgs e)
|
2024-03-17 18:37:06 -07:00
|
|
|
{
|
2024-08-06 00:12:44 -07:00
|
|
|
if (e.ClickCount == 1)
|
|
|
|
BeginMoveDrag(e);
|
2024-07-14 00:55:15 -07:00
|
|
|
|
2024-08-06 00:12:44 -07:00
|
|
|
e.Handled = true;
|
2024-06-13 02:55:22 -07:00
|
|
|
}
|
2024-08-23 20:36:02 -07:00
|
|
|
|
|
|
|
private void OnPressCommitSHA(object sender, PointerPressedEventArgs e)
|
|
|
|
{
|
|
|
|
if (sender is TextBlock { DataContext: Models.Commit commit } &&
|
|
|
|
DataContext is ViewModels.FileHistories vm)
|
|
|
|
{
|
|
|
|
vm.NavigateToCommit(commit);
|
|
|
|
}
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
}
|
2024-08-23 21:06:38 -07:00
|
|
|
|
|
|
|
private void OnResetToSelectedRevision(object _, RoutedEventArgs e)
|
|
|
|
{
|
|
|
|
if (DataContext is ViewModels.FileHistories vm)
|
|
|
|
{
|
|
|
|
vm.ResetToSelectedRevision();
|
|
|
|
NotifyDonePanel.IsVisible = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnCloseNotifyPanel(object _, PointerPressedEventArgs e)
|
|
|
|
{
|
|
|
|
NotifyDonePanel.IsVisible = false;
|
|
|
|
e.Handled = true;
|
|
|
|
}
|
2024-02-05 23:08:37 -08:00
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
}
|