mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 08:06:31 +00:00
fix keyboard event retrieving for dataset explorer
This commit is contained in:
@@ -24,7 +24,6 @@ public partial class DatasetExplorer
|
||||
|
||||
private int _tempSelectedClassIdx = 0;
|
||||
private readonly IGalleryManager _galleryManager;
|
||||
private readonly FormState _formState;
|
||||
|
||||
public bool ThumbnailLoading { get; set; }
|
||||
|
||||
@@ -41,10 +40,10 @@ public partial class DatasetExplorer
|
||||
_annotationConfig = annotationConfig.Value;
|
||||
_logger = logger;
|
||||
_galleryManager = galleryManager;
|
||||
_formState = formState;
|
||||
|
||||
InitializeComponent();
|
||||
Loaded += OnLoaded;
|
||||
Activated += (_, _) => formState.ActiveWindow = WindowEnum.DatasetExplorer;
|
||||
|
||||
ThumbnailsView.KeyDown += async (sender, args) =>
|
||||
{
|
||||
@@ -109,7 +108,6 @@ public partial class DatasetExplorer
|
||||
foreach (var ann in ExplorerEditor.CurrentAnns.Where(x => x.IsSelected))
|
||||
ann.AnnotationClass = selectedClass;
|
||||
};
|
||||
Activated += (_, _) => _formState.ActiveWindow = WindowEnum.Annotator;
|
||||
|
||||
LvClasses.SelectedIndex = _annotationConfig.LastSelectedExplorerClass ?? 0;
|
||||
ExplorerEditor.CurrentAnnClass = (AnnotationClass)LvClasses.SelectedItem;
|
||||
|
||||
@@ -88,9 +88,8 @@ public partial class App
|
||||
AppDomain.CurrentDomain.AssemblyResolve += (_, a) => _resourceLoader.LoadAssembly(a.Name);
|
||||
|
||||
StartMain();
|
||||
|
||||
EventManager.RegisterClassHandler(typeof(UIElement), UIElement.KeyDownEvent, new RoutedEventHandler(GlobalClick));
|
||||
await _host.StartAsync();
|
||||
EventManager.RegisterClassHandler(typeof(UIElement), UIElement.KeyDownEvent, new RoutedEventHandler(GlobalClick));
|
||||
_host.Services.GetRequiredService<MainSuite>().Show();
|
||||
};
|
||||
|
||||
@@ -169,7 +168,6 @@ public partial class App
|
||||
private void GlobalClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var args = (KeyEventArgs)e;
|
||||
|
||||
var keyEvent = new KeyEvent(sender, args, _formState.ActiveWindow);
|
||||
_ = ThrottleExt.Throttle(() => _mediator.Publish(keyEvent), TimeSpan.FromMilliseconds(50));
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ public partial class Login
|
||||
|
||||
private void LoginClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoginBtn.Cursor = Cursors.Wait;
|
||||
Cursor = Cursors.Wait;
|
||||
CredentialsEntered?.Invoke(this, new ApiCredentials(TbEmail.Text, TbPassword.Password));
|
||||
Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user