mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-27 05:15:05 +00:00
feature: support to use input control in custom action
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
a8803ca188
commit
676785f8b1
26 changed files with 659 additions and 56 deletions
|
@ -12,6 +12,14 @@ namespace SourceGit.Views
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
|
||||
if (!e.Handled && e.Key == Key.Escape)
|
||||
Close();
|
||||
}
|
||||
|
||||
protected override void OnClosing(WindowClosingEventArgs e)
|
||||
{
|
||||
base.OnClosing(e);
|
||||
|
@ -35,12 +43,18 @@ namespace SourceGit.Views
|
|||
e.Handled = true;
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
private async void EditCustomActionControls(object sender, RoutedEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
if (sender is not Button { DataContext: Models.CustomAction act })
|
||||
return;
|
||||
|
||||
if (!e.Handled && e.Key == Key.Escape)
|
||||
Close();
|
||||
var dialog = new ConfigureCustomActionControls()
|
||||
{
|
||||
DataContext = new ViewModels.ConfigureCustomActionControls(act.Controls)
|
||||
};
|
||||
|
||||
await dialog.ShowDialog(this);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue