mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Fix mouse click issues and add a new hotmovie plugin.
This commit is contained in:
@@ -3,15 +3,27 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Plugin;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using UserControl = System.Windows.Controls.UserControl;
|
||||
|
||||
namespace Wox
|
||||
{
|
||||
public partial class ResultPanel : UserControl
|
||||
{
|
||||
public event Action<Result> OnMouseClickItem;
|
||||
|
||||
protected virtual void OnOnMouseClickItem(Result result)
|
||||
{
|
||||
Action<Result> handler = OnMouseClickItem;
|
||||
if (handler != null) handler(result);
|
||||
}
|
||||
|
||||
public bool Dirty { get; set; }
|
||||
|
||||
public void AddResults(List<Result> results)
|
||||
@@ -141,5 +153,14 @@ namespace Wox
|
||||
lbResults.ScrollIntoView(e.AddedItems[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private void LbResults_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var item = ItemsControl.ContainerFromElement(lbResults, e.OriginalSource as DependencyObject) as ListBoxItem;
|
||||
if (item != null)
|
||||
{
|
||||
OnOnMouseClickItem(item.DataContext as Result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user