mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
feature: add worktree support (#205)
This commit is contained in:
parent
43af8c49a1
commit
8a8aabede3
23 changed files with 959 additions and 21 deletions
28
src/Views/AddWorktree.axaml.cs
Normal file
28
src/Views/AddWorktree.axaml.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class AddWorktree : UserControl
|
||||
{
|
||||
public AddWorktree()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void SelectLocation(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var options = new FolderPickerOpenOptions() { AllowMultiple = false };
|
||||
var toplevel = TopLevel.GetTopLevel(this);
|
||||
if (toplevel == null)
|
||||
return;
|
||||
|
||||
var selected = await toplevel.StorageProvider.OpenFolderPickerAsync(options);
|
||||
if (selected.Count == 1)
|
||||
TxtLocation.Text = selected[0].Path.LocalPath;
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue