mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Fix dragndrop cursor getting stuck when main thread is busy
This commit is contained in:
@@ -674,12 +674,14 @@ namespace Flowframes.Forms.Main
|
||||
|
||||
private void Form1_DragEnter(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; }
|
||||
|
||||
private void Form1_DragDrop(object sender, DragEventArgs e)
|
||||
private async void Form1_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
DragDropHandler((string[])e.Data.GetData(DataFormats.FileDrop));
|
||||
var files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
await Task.Delay(1); // Release drop
|
||||
DragDropHandler(files);
|
||||
}
|
||||
|
||||
public void DragDropHandler(string[] files)
|
||||
public void DragDropHandler(string[] files, bool first = true)
|
||||
{
|
||||
if (Program.busy) return;
|
||||
|
||||
@@ -689,13 +691,12 @@ namespace Flowframes.Forms.Main
|
||||
{
|
||||
SetTab(interpOptsTab.Name);
|
||||
queueBtn_Click(null, null);
|
||||
if (BatchProcessing.currentBatchForm != null)
|
||||
BatchProcessing.currentBatchForm.LoadDroppedPaths(files, start);
|
||||
BatchProcessing.currentBatchForm?.LoadDroppedPaths(files, start);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTab(interpOptsTab.Name);
|
||||
Logger.Log("Selected video/directory: " + Path.GetFileName(files[0]), true);
|
||||
Logger.Log($"Selected video/directory: {Path.GetFileName(files[0])}", true);
|
||||
inputTbox.Text = files[0];
|
||||
|
||||
bool resume = Directory.Exists(files[0]) && IoUtils.GetAmountOfFiles(Path.Combine(files[0], Paths.resumeDir), true, "*.json") > 0;
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Flowframes.Forms
|
||||
|
||||
@@ -381,8 +381,8 @@ namespace Flowframes.Main
|
||||
|
||||
public static Fraction AskForFramerate(string mediaName, bool isImageSequence = true)
|
||||
{
|
||||
string text = $"Please enter an input frame rate to use for{(isImageSequence ? " the image sequence" : "")} '{mediaName.Trunc(80)}'.";
|
||||
PromptForm form = new PromptForm("Enter Frame Rate", text, "15");
|
||||
string text = $"Please enter the source frame rate for{(isImageSequence ? " the image sequence" : "")} '{mediaName.Trunc(80)}'.";
|
||||
var form = new PromptForm("Enter Frame Rate", text, "15");
|
||||
form.ShowDialog();
|
||||
return new Fraction(form.EnteredText);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user