mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Refactoring ContextMenu
1. Remove ItemDropEvent 2. Remove ShowContextMenus from API 3. Fix context menu item can't be opened ( #535 ), bug introduced from PR #494 (commit 45dbb50) 4. Move open result command and load context menu command back to MainViewModel 5. unify load context menu logic 6. other performance enhancement and potential bug fixed
This commit is contained in:
@@ -30,9 +30,10 @@ namespace Wox
|
||||
GlobalHotkey.Instance.hookedKeyboardCallback += KListener_hookedKeyboardCallback;
|
||||
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
|
||||
|
||||
MainVM.ListeningKeyPressed += (o, e) => {
|
||||
MainVM.ListeningKeyPressed += (o, e) =>
|
||||
{
|
||||
|
||||
if(e.KeyEventArgs.Key == Key.Back)
|
||||
if (e.KeyEventArgs.Key == Key.Back)
|
||||
{
|
||||
BackKeyDownEvent?.Invoke(new WoxKeyDownEventArgs
|
||||
{
|
||||
@@ -158,20 +159,6 @@ namespace Wox
|
||||
MainVM.UpdateResultView(results, plugin, query);
|
||||
}
|
||||
|
||||
public void ShowContextMenu(PluginMetadata plugin, List<Result> results)
|
||||
{
|
||||
if (results != null && results.Count > 0)
|
||||
{
|
||||
results.ForEach(o =>
|
||||
{
|
||||
o.PluginDirectory = plugin.PluginDirectory;
|
||||
o.PluginID = plugin.ID;
|
||||
});
|
||||
|
||||
MainVM.ShowContextMenu(results, plugin.ID);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
Reference in New Issue
Block a user