mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature: workspace support (#445)
This commit is contained in:
parent
acd6171350
commit
ebc112a627
27 changed files with 473 additions and 109 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue