simplify the drag code a little
This commit is contained in:
parent
604ae82d0b
commit
9ed0d168e7
|
@ -204,6 +204,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
[fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
|
[fFilterBar setBackgroundImage: [NSImage imageNamed: @"FilterBarBackground.png"]];
|
||||||
|
|
||||||
[fWindow setAcceptsMouseMovedEvents: YES]; //ensure filter buttons display correctly
|
[fWindow setAcceptsMouseMovedEvents: YES]; //ensure filter buttons display correctly
|
||||||
|
[fWindow addChildWindow: fOverlayWindow ordered: NSWindowAbove];
|
||||||
|
|
||||||
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Transmission Toolbar"];
|
fToolbar = [[NSToolbar alloc] initWithIdentifier: @"Transmission Toolbar"];
|
||||||
[fToolbar setDelegate: self];
|
[fToolbar setDelegate: self];
|
||||||
|
@ -2103,8 +2104,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
tr_torrentClose(fLib, tempTor);
|
tr_torrentClose(fLib, tempTor);
|
||||||
|
|
||||||
[fOverlayWindow setFiles: files];
|
[fOverlayWindow setFiles: files];
|
||||||
[fOverlayWindow setFrame: [fWindow frame] display: YES];
|
|
||||||
[fWindow addChildWindow: fOverlayWindow ordered: NSWindowAbove];
|
|
||||||
|
|
||||||
return NSDragOperationCopy;
|
return NSDragOperationCopy;
|
||||||
}
|
}
|
||||||
|
@ -2113,8 +2112,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
else if ([[pasteboard types] containsObject: NSURLPboardType])
|
else if ([[pasteboard types] containsObject: NSURLPboardType])
|
||||||
{
|
{
|
||||||
[fOverlayWindow setURL: [[NSURL URLFromPasteboard: pasteboard] relativeString]];
|
[fOverlayWindow setURL: [[NSURL URLFromPasteboard: pasteboard] relativeString]];
|
||||||
[fOverlayWindow setFrame: [fWindow frame] display: YES];
|
|
||||||
[fWindow addChildWindow: fOverlayWindow ordered: NSWindowAbove];
|
|
||||||
|
|
||||||
return NSDragOperationCopy;
|
return NSDragOperationCopy;
|
||||||
}
|
}
|
||||||
|
@ -2123,15 +2120,13 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
return NSDragOperationNone;
|
return NSDragOperationNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) draggingExited: (id <NSDraggingInfo>) sender
|
- (void) draggingExited: (id <NSDraggingInfo>) info
|
||||||
{
|
{
|
||||||
[fWindow removeChildWindow: fOverlayWindow];
|
|
||||||
[fOverlayWindow closeFadeOut];
|
[fOverlayWindow closeFadeOut];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) performDragOperation: (id <NSDraggingInfo>) info
|
- (BOOL) performDragOperation: (id <NSDraggingInfo>) info
|
||||||
{
|
{
|
||||||
[fWindow removeChildWindow: fOverlayWindow];
|
|
||||||
[fOverlayWindow closeFadeOut];
|
[fOverlayWindow closeFadeOut];
|
||||||
|
|
||||||
NSPasteboard * pasteboard = [info draggingPasteboard];
|
NSPasteboard * pasteboard = [info draggingPasteboard];
|
||||||
|
@ -2163,6 +2158,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
if ((url = [NSURL URLFromPasteboard: pasteboard]))
|
if ((url = [NSURL URLFromPasteboard: pasteboard]))
|
||||||
{
|
{
|
||||||
[self openURL: url];
|
[self openURL: url];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,8 +179,6 @@
|
||||||
{
|
{
|
||||||
[fFadeOutTimer invalidate];
|
[fFadeOutTimer invalidate];
|
||||||
fFadeOutTimer = nil;
|
fFadeOutTimer = nil;
|
||||||
|
|
||||||
[self close];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue