mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Merge pull request #5540 from Craftplacer/master
Add drag drop support for notifications with file name
This commit is contained in:
commit
e607cc481e
1 changed files with 11 additions and 0 deletions
|
@ -26,6 +26,7 @@ You should have received a copy of the GNU General Public License
|
||||||
using ShareX.HelpersLib;
|
using ShareX.HelpersLib;
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace ShareX
|
namespace ShareX
|
||||||
|
@ -361,6 +362,15 @@ private void NotificationForm_MouseLeave(object sender, EventArgs e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NotificationForm_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(Config.FilePath) && File.Exists(Config.FilePath))
|
||||||
|
{
|
||||||
|
IDataObject dataObject = new DataObject(DataFormats.FileDrop, new string[] { Config.FilePath });
|
||||||
|
DoDragDrop(dataObject, DragDropEffects.Copy | DragDropEffects.Move);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
private Timer tDuration;
|
private Timer tDuration;
|
||||||
|
@ -412,6 +422,7 @@ private void InitializeComponent()
|
||||||
MouseClick += new MouseEventHandler(NotificationForm_MouseClick);
|
MouseClick += new MouseEventHandler(NotificationForm_MouseClick);
|
||||||
MouseEnter += new EventHandler(NotificationForm_MouseEnter);
|
MouseEnter += new EventHandler(NotificationForm_MouseEnter);
|
||||||
MouseLeave += new EventHandler(NotificationForm_MouseLeave);
|
MouseLeave += new EventHandler(NotificationForm_MouseLeave);
|
||||||
|
MouseDown += new MouseEventHandler(NotificationForm_MouseDown);
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue