summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2013-04-18 16:15:59 +0000
committerManolo Gouy <Manolo>2013-04-18 16:15:59 +0000
commit53e2e603d0db67aa1d28557da2bca876902105e0 (patch)
tree23f45f1dc6e0ed13e7faaa8bf02d11f85676c437 /src
parenta75891051741b78e09196b63a0fbd29a2a51effc (diff)
Cosmetic improvement of image used when dragging non-text data.
Minimum OS version still has to be verified. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9891 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 61916e3e5..96ca221e4 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3232,14 +3232,30 @@ static NSImage *imageFromText(const char *text, int *pwidth, int *pheight)
static NSImage *defaultDragImage(int *pwidth, int *pheight)
{
- const int width = 16, height = 16;
+ const int version_threshold = 100800;
+ int width, height;
+ if (fl_mac_os_version >= version_threshold) {
+ width = 50; height = 40;
+ }
+ else {
+ width = 16; height = 16;
+ }
Fl_Offscreen off = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(width, height);
fl_begin_offscreen(off);
- CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0);
- fl_rectf(0,0,width,height);
- CGContextSetRGBStrokeColor( (CGContextRef)off, 0,0,0,0.6);
- fl_rect(0,0,width,height);
- fl_rect(2,2,width-4,height-4);
+ if (fl_mac_os_version >= version_threshold) {
+ fl_font(FL_HELVETICA, 20);
+ fl_color(FL_BLACK);
+ char str[4];
+ int l = fl_utf8encode(0x1F69A, str); // the "Delivery truck" Unicode character
+ fl_draw(str, l, 1, 16);
+ }
+ else { // draw two squares
+ CGContextSetRGBFillColor( (CGContextRef)off, 0,0,0,0);
+ fl_rectf(0,0,width,height);
+ CGContextSetRGBStrokeColor( (CGContextRef)off, 0,0,0,0.6);
+ fl_rect(0,0,width,height);
+ fl_rect(2,2,width-4,height-4);
+ }
fl_end_offscreen();
NSImage* image = CGBitmapContextToNSImage( (CGContextRef)off );
fl_delete_offscreen( off );