mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Change logic to not do anything if file not exist.
This commit is contained in:
parent
234156b153
commit
9ca67acc5d
1 changed files with 8 additions and 10 deletions
|
|
@ -80,20 +80,18 @@ namespace Flow.Launcher
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Point mpos = e.GetPosition(null);
|
Point mousePosition = e.GetPosition(null);
|
||||||
Vector diff = this.start - mpos;
|
Vector diff = this.start - mousePosition;
|
||||||
|
|
||||||
if (Math.Abs(diff.X) < SystemParameters.MinimumHorizontalDragDistance
|
if (Math.Abs(diff.X) < SystemParameters.MinimumHorizontalDragDistance
|
||||||
|| Math.Abs(diff.Y) < SystemParameters.MinimumVerticalDragDistance)
|
|| Math.Abs(diff.Y) < SystemParameters.MinimumVerticalDragDistance
|
||||||
|
|| !File.Exists(file))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DataObject data;
|
var data = new DataObject(DataFormats.FileDrop, new[]
|
||||||
data = File.Exists(file)
|
{
|
||||||
? new DataObject(DataFormats.FileDrop, new[]
|
file
|
||||||
{
|
});
|
||||||
file
|
|
||||||
})
|
|
||||||
: new DataObject(DataFormats.UnicodeText, file);
|
|
||||||
DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy);
|
DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue