mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-03 10:36:30 +13:00
Re-enabled drag and drop
This commit is contained in:
parent
1d0741d54e
commit
c68f7413d9
1 changed files with 16 additions and 0 deletions
|
@ -16,6 +16,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
using SystemTrayMenu.Business;
|
||||
using SystemTrayMenu.DataClasses;
|
||||
using SystemTrayMenu.DllImports;
|
||||
using SystemTrayMenu.Helpers;
|
||||
using SystemTrayMenu.Properties;
|
||||
using SystemTrayMenu.Utilities;
|
||||
|
||||
|
@ -209,6 +210,15 @@ namespace SystemTrayMenu.UserInterface
|
|||
item.SubMenu?.Close();
|
||||
}
|
||||
};
|
||||
|
||||
bool isTouchEnabled = NativeMethods.IsTouchEnabled();
|
||||
if ((isTouchEnabled && Settings.Default.DragDropItemsEnabledTouch) ||
|
||||
(!isTouchEnabled && Settings.Default.DragDropItemsEnabled))
|
||||
{
|
||||
AllowDrop = true;
|
||||
DragEnter += DragDropHelper.DragEnter;
|
||||
Drop += DragDropHelper.DragDrop;
|
||||
}
|
||||
}
|
||||
|
||||
internal event Action<RowData>? StartLoadSubMenu;
|
||||
|
@ -1147,6 +1157,12 @@ namespace SystemTrayMenu.UserInterface
|
|||
if (!isShellContextMenuOpen)
|
||||
{
|
||||
CellMouseLeave?.Invoke();
|
||||
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
string[] files = new string[] { ((RowData)((ListViewItem)sender).Content).Path };
|
||||
DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, files), DragDropEffects.Copy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue