feature: workspace support (#445)

This commit is contained in:
leo 2024-09-09 18:26:43 +08:00
parent acd6171350
commit ebc112a627
No known key found for this signature in database
27 changed files with 473 additions and 109 deletions

View file

@ -3,6 +3,7 @@ using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.VisualTree;
namespace SourceGit.Views
@ -223,9 +224,7 @@ namespace SourceGit.Views
var pref = ViewModels.Preference.Instance;
pref.Layout.LauncherWidth = Width;
pref.Layout.LauncherHeight = Height;
var vm = DataContext as ViewModels.Launcher;
vm?.Quit();
pref.Save();
base.OnClosing(e);
}
@ -248,6 +247,17 @@ namespace SourceGit.Views
e.Handled = true;
}
private void OnOpenWorkspaceMenu(object sender, RoutedEventArgs e)
{
if (sender is Button btn && DataContext is ViewModels.Launcher launcher)
{
var menu = launcher.CreateContextForWorkspace();
btn.OpenContextMenu(menu);
}
e.Handled = true;
}
private KeyModifiers _unhandledModifiers = KeyModifiers.None;
}
}