[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:36:41 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit eda6360823f5ff0b859594f2c93ed05d4afab151
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 6 03:10:50 2002 +0000
Experiment w/ dragging link label as drag image.
Needs some visual tweaking, but good concept, I think.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView mouseDragged:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 667db7e..feea718 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,13 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+ Experiment w/ dragging link label as drag image.
+ Needs some visual tweaking, but good concept, I think.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
Use the first text child node of the link element
as the title for a dragged link. We'll use this for
the dragged image later too.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 667db7e..feea718 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,13 @@
2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+ Experiment w/ dragging link label as drag image.
+ Needs some visual tweaking, but good concept, I think.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView mouseDragged:]):
+
+2002-09-05 Richard Williamson (Local) <rjw at apple.com>
+
Use the first text child node of the link element
as the title for a dragged link. We'll use this for
the dragged image later too.
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index ebeb095..4b1932e 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -449,16 +449,26 @@
if (!label)
label = [linkURL absoluteString];
- // FIXME: Create an image w/ the label.
+ NSFont *dragImageFont = [NSFont systemFontOfSize: 12.0];
+ NSDictionary *dragImageAttributes = [NSDictionary dictionaryWithObject:dragImageFont forKey: NSFontAttributeName];
+ NSSize imageSize = [label sizeWithAttributes: dragImageAttributes];
+ imageSize.width += 4.0;
+ imageSize.height += 4.0;
+ NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease];
+ [dragImage lockFocus];
+ [[NSColor colorWithCalibratedRed: 0.25 green: 0.25 blue: 0.75 alpha: 0.5] set];
+ [NSBezierPath fillRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)];
+ [label drawAtPoint: NSMakePoint (2.0,2.0) withAttributes: dragImageAttributes];
+ [dragImage unlockFocus];
NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];
[pasteboard declareTypes:[NSArray arrayWithObjects:NSURLPboardType, WebURLsWithTitlesPboardType, nil] owner:nil];
[WebURLsWithTitles writeURLs:[NSArray arrayWithObjects: linkURL, nil] andTitles:[NSArray arrayWithObjects: label, nil] toPasteboard:pasteboard];
- //[_private->draggedURL writeToPasteboard: pasteboard];
- NSSize offset = WebIconSmallSize;
- offset.width /= 2;
- offset.height /= 2;
- [self dragImage:[[WebIconDatabase sharedIconDatabase] defaultIconWithSize:WebIconSmallSize]
+
+ NSSize offset;
+ offset.width = 0;
+ offset.height = 0;
+ [self dragImage:dragImage
at:[self convertPoint:[event locationInWindow] fromView:nil]
offset:offset
event:event
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list