mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:20:37 +00:00
DnD cleanups and fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21028 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
960ae57b10
commit
b9c4cc1832
6 changed files with 125 additions and 61 deletions
|
@ -416,14 +416,21 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
|||
{
|
||||
NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSDragPboard];
|
||||
NSImage *image = [NSImage imageNamed: @"common_ColorSwatch"];
|
||||
NSSize s;
|
||||
NSPoint p;
|
||||
|
||||
[pb declareTypes: [NSArray arrayWithObjects: NSColorPboardType, nil]
|
||||
owner: aColor];
|
||||
[aColor writeToPasteboard: pb];
|
||||
[image setBackgroundColor: aColor];
|
||||
|
||||
s = [image size];
|
||||
p = [sourceView convertPoint: [anEvent locationInWindow] fromView: nil];
|
||||
p.x -= s.width/2;
|
||||
p.y -= s.width/2;
|
||||
|
||||
[sourceView dragImage: image
|
||||
at: [sourceView bounds].origin
|
||||
at: p
|
||||
offset: NSMakeSize(0,0)
|
||||
event: anEvent
|
||||
pasteboard: pb
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue