[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:44:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b0e5f4530ecbeefaaf36c3b651e3d7b0c757faf8
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 26 22:11:39 2002 +0000

    i        Use a rectangle with rounded corners for dragged label.
            Put a subtle shadow behind text in label.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView mouseDragged:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 59c0485..bdda709 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,11 @@
+2002-09-26  Richard Williamson   <rjw at apple.com>
+
+        Use a rectangle with rounded corners for dragged label.
+        Put a subtle shadow behind text in label.
+        
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView mouseDragged:]):
+
 2002-09-26  Chris Blumenberg  <cblu at apple.com>
 
 	- When dragging an image, use the image itself for the drag image
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 59c0485..bdda709 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,11 @@
+2002-09-26  Richard Williamson   <rjw at apple.com>
+
+        Use a rectangle with rounded corners for dragged label.
+        Put a subtle shadow behind text in label.
+        
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView mouseDragged:]):
+
 2002-09-26  Chris Blumenberg  <cblu at apple.com>
 
 	- When dragging an image, use the image itself for the drag image
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 46f7fa7..65ed411 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -35,12 +35,17 @@
 
 #define DRAG_LABEL_BORDER_X		4.0
 #define DRAG_LABEL_BORDER_Y		2.0
+#define DRAG_LABEL_RADIUS	5
 
 #define MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP	120.0
 
 #define DragImageAlpha    		0.75
 #define MaxDragSize 			NSMakeSize(400, 400)
 
+#import <CoreGraphics/CGStyle.h>
+#import <CoreGraphics/CGSTypes.h>
+#import <CoreGraphics/CGContextGState.h>
+
 @implementation WebHTMLView
 
 - initWithFrame: (NSRect) frame
@@ -561,8 +566,36 @@
                 }
                 NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease];
                 [dragImage lockFocus];
+
                 [[NSColor colorWithCalibratedRed: 0.75 green: 0.75 blue: 1.0 alpha: 0.75] set];
-                [NSBezierPath fillRect:NSMakeRect(0, 0, imageSize.width, imageSize.height)];
+
+                // Drag a rectangle with rounded corners/
+                NSBezierPath *path = [NSBezierPath bezierPath];
+                [path appendBezierPathWithOvalInRect: NSMakeRect(0,0, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
+                [path appendBezierPathWithOvalInRect: NSMakeRect(0,imageSize.height - DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
+                [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2, imageSize.height - DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
+                [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2,0, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
+            
+                [path appendBezierPathWithRect: NSMakeRect(DRAG_LABEL_RADIUS, 0, imageSize.width - DRAG_LABEL_RADIUS * 2, imageSize.height)];
+                [path appendBezierPathWithRect: NSMakeRect(0, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 10, imageSize.height - 2 * DRAG_LABEL_RADIUS)];
+                [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS - 20,DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 20, imageSize.height - 2 * DRAG_LABEL_RADIUS)];
+                [path fill];
+            
+                // Draw the label with a slight shadow.
+                CGShadowStyle shadow;
+                CGSGenericObj style;
+                
+                shadow.version    = 0;
+                shadow.elevation  = kCGShadowElevationDefault;
+                shadow.azimuth    = 136.869995;
+                shadow.ambient    = 0.317708;
+                shadow.height     = 2.187500;
+                shadow.radius     = 1.875000;
+                shadow.saturation = kCGShadowSaturationDefault;
+                style = CGStyleCreateShadow(&shadow);
+                [NSGraphicsContext saveGraphicsState];
+                CGContextSetStyle([[NSGraphicsContext currentContext] graphicsPort], style);
+
                 if (drawURLString){
                     if (clipURLString) {
                         urlString = [WebStringTruncator rightTruncateString: urlString toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2) withFont:urlFont];
@@ -570,6 +603,10 @@
                     [urlString drawAtPoint: NSMakePoint(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y) withAttributes: urlAttributes];
                 }
                 [label drawAtPoint: NSMakePoint (DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y + urlStringSize.height) withAttributes: labelAttributes];
+
+                [NSGraphicsContext restoreGraphicsState];
+                CGStyleRelease(style);
+
                 [dragImage unlockFocus];
 
                 NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSDragPboard];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list