summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-06-17 12:44:28 +0200
committerDamiano Galassi <[email protected]>2016-06-17 12:44:28 +0200
commit221bfe7afa05f8a0a9f85027992328b7c5226de2 (patch)
tree37a1681efa8ab32d8b1d42318a4f761660ef7918
parent63b26387e57bf122ce9c7f5d8554a3dd08914f0f (diff)
MacGui: fix drag&drop on the main window tab view.
-rw-r--r--macosx/HBController.m6
-rw-r--r--macosx/HBTabView.m7
2 files changed, 12 insertions, 1 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m
index 776e78302..7dfa61709 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -196,6 +196,7 @@
// Register HBController's Window as a receiver for files/folders drag & drop operations
[self.window registerForDraggedTypes:@[NSFilenamesPboardType]];
+ [fMainTabView registerForDraggedTypes:@[NSFilenamesPboardType]];
// Set up the preset drawer
fPresetsView = [[HBPresetsViewController alloc] initWithPresetManager:presetManager];
@@ -251,6 +252,11 @@
return fileURLs.count ? NSDragOperationGeneric : NSDragOperationNone;
}
+- (BOOL)prepareForDragOperation:(id<NSDraggingInfo>)sender
+{
+ return YES;
+}
+
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSArray<NSURL *> *fileURLs = [self fileURLsFromPasteboard:[sender draggingPasteboard]];
diff --git a/macosx/HBTabView.m b/macosx/HBTabView.m
index f0adc6544..dc20f0223 100644
--- a/macosx/HBTabView.m
+++ b/macosx/HBTabView.m
@@ -9,11 +9,16 @@
@implementation HBTabView
--(NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender
{
return [self.dropDelegate draggingEntered:sender];
}
+- (BOOL)prepareForDragOperation:(id<NSDraggingInfo>)sender
+{
+ return [self.dropDelegate prepareForDragOperation:sender];
+}
+
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
return [self.dropDelegate performDragOperation:sender];