mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-03 02:36:50 +13:00
Use ItemDrag item instead of selected item to get correct dragged item
This commit is contained in:
parent
a6603f3e1a
commit
2c65d618dc
1 changed files with 10 additions and 4 deletions
|
@ -1278,12 +1278,18 @@ private void lvUploads_KeyDown(object sender, KeyEventArgs e)
|
|||
|
||||
private void lvUploads_ItemDrag(object sender, ItemDragEventArgs e)
|
||||
{
|
||||
TaskInfo task = GetCurrentUploadInfo();
|
||||
ListViewItem item = e.Item as ListViewItem;
|
||||
|
||||
if (task != null && !string.IsNullOrEmpty(task.FilePath) && File.Exists(task.FilePath))
|
||||
if (item != null)
|
||||
{
|
||||
WorkerTask task = item.Tag as WorkerTask;
|
||||
|
||||
if (task != null && task.Info != null && !string.IsNullOrEmpty(task.Info.FilePath) && File.Exists(task.Info.FilePath))
|
||||
{
|
||||
AllowDrop = false;
|
||||
lvUploads.DoDragDrop(new DataObject(DataFormats.FileDrop, new string[] { task.FilePath }), DragDropEffects.Copy);
|
||||
|
||||
lvUploads.DoDragDrop(new DataObject(DataFormats.FileDrop, new string[] { task.Info.FilePath }), DragDropEffects.Copy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue