summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/nibs/DownloadShelf.xib24
-rw-r--r--chrome/browser/cocoa/download_item_cell.mm65
-rw-r--r--chrome/browser/cocoa/download_shelf_controller.mm7
3 files changed, 44 insertions, 52 deletions
diff --git a/chrome/app/nibs/DownloadShelf.xib b/chrome/app/nibs/DownloadShelf.xib
index a910eab..9ea3dc12 100644
--- a/chrome/app/nibs/DownloadShelf.xib
+++ b/chrome/app/nibs/DownloadShelf.xib
@@ -41,8 +41,8 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="538957441">
<reference key="NSNextResponder" ref="1005"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{456, 12}, {15, 15}}</string>
+ <int key="NSvFlags">257</int>
+ <string key="NSFrame">{{456, 14}, {15, 15}}</string>
<reference key="NSSuperview" ref="1005"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="104399124">
@@ -73,7 +73,7 @@
</object>
<object class="NSScrollView" id="433009119">
<reference key="NSNextResponder" ref="1005"/>
- <int key="NSvFlags">289</int>
+ <int key="NSvFlags">257</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSClipView" id="581923208">
@@ -280,7 +280,7 @@
</object>
<int key="NSTVFlags">6</int>
<string key="NSMaxSize">{463, 1e+07}</string>
- <string key="NSMinize">{63, 3}</string>
+ <string key="NSMinize">{63, 0}</string>
<nil key="NSDelegate"/>
</object>
</object>
@@ -316,7 +316,7 @@
<double key="NSPercent">9.456522e-01</double>
</object>
</object>
- <string key="NSFrame">{{266, 13}, {182, 14}}</string>
+ <string key="NSFrame">{{266, 15}, {182, 14}}</string>
<reference key="NSSuperview" ref="1005"/>
<reference key="NSNextKeyView" ref="581923208"/>
<int key="NSsFlags">0</int>
@@ -326,14 +326,14 @@
</object>
<object class="NSCustomView" id="931787328">
<reference key="NSNextResponder" ref="1005"/>
- <int key="NSvFlags">290</int>
- <string key="NSFrame">{{3, 0}, {240, 40}}</string>
+ <int key="NSvFlags">258</int>
+ <string key="NSFrame">{{3, 5}, {240, 34}}</string>
<reference key="NSSuperview" ref="1005"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSImageView" id="663605208">
<reference key="NSNextResponder" ref="1005"/>
- <int key="NSvFlags">289</int>
+ <int key="NSvFlags">257</int>
<object class="NSMutableSet" key="NSDragTypes">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="set.sortedObjects">
@@ -346,7 +346,7 @@
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{245, 11}, {16, 16}}</string>
+ <string key="NSFrame">{{245, 13}, {16, 16}}</string>
<reference key="NSSuperview" ref="1005"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="673439633">
@@ -364,7 +364,7 @@
<bool key="NSEditable">YES</bool>
</object>
</object>
- <string key="NSFrameSize">{480, 40}</string>
+ <string key="NSFrameSize">{480, 44}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">DownloadShelfView</string>
</object>
@@ -549,7 +549,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{845, 30}, {480, 40}}</string>
+ <string>{{208, 193}, {480, 44}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{628, 654}</string>
<string>{{357, 416}, {480, 272}}</string>
@@ -612,6 +612,7 @@
<string>image_</string>
<string>itemContainerView_</string>
<string>linkContainer_</string>
+ <string>resizeDelegate_</string>
<string>showAllDownloadsLink_</string>
</object>
<object class="NSMutableArray" key="dict.values">
@@ -619,6 +620,7 @@
<string>NSImageView</string>
<string>NSView</string>
<string>NSScrollView</string>
+ <string>id</string>
<string>NSTextView</string>
</object>
</object>
diff --git a/chrome/browser/cocoa/download_item_cell.mm b/chrome/browser/cocoa/download_item_cell.mm
index b1d5a29..795cc99 100644
--- a/chrome/browser/cocoa/download_item_cell.mm
+++ b/chrome/browser/cocoa/download_item_cell.mm
@@ -16,19 +16,19 @@
namespace {
// Distance from top border to icon
-const CGFloat kImagePaddingTop = 1;
+const CGFloat kImagePaddingTop = 8;
// Distance from left border to icon
-const CGFloat kImagePaddingLeft = 1;
+const CGFloat kImagePaddingLeft = 5;
// Width of icon
-const CGFloat kImageWidth = 32;
+const CGFloat kImageWidth = 16;
// Height of icon
-const CGFloat kImageHeight = 32;
+const CGFloat kImageHeight = 16;
// x coordinate of download name string, in view coords
-const CGFloat kTextPosLeft = kImagePaddingLeft + kImageWidth + 1;
+const CGFloat kTextPosLeft = kImagePaddingLeft + kImageWidth + 4 + 1;
// Distance from end of download name string to dropdown area
const CGFloat kTextPaddingRight = 3;
@@ -44,8 +44,9 @@ const CGFloat kPrimaryTextOnlyPosTop = 10;
// y coordinate of status message, in view coords
const CGFloat kSecondaryTextPosTop = 17;
-// Width of dropdown area on the right
-const CGFloat kDropdownAreaWidth = 18;
+// Width of dropdown area on the right (includes 1px for the border on each
+// side).
+const CGFloat kDropdownAreaWidth = 14;
// Width of dropdown arrow
const CGFloat kDropdownArrowWidth = 5;
@@ -260,13 +261,12 @@ NSTimeInterval kHideStatusDuration = 0.3;
}
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
-
- // Constants from Cole. Will kConstan them once the feedback loop
+ // Constants from Cole. Will kConstant them once the feedback loop
// is complete.
NSRect drawFrame = NSInsetRect(cellFrame, 0.5, 0.5);
NSRect innerFrame = NSInsetRect(cellFrame, 1, 1);
- const float radius = 3.5;
+ const float radius = 5;
NSWindow* window = [controlView window];
BOOL active = [window isKeyWindow] || [window isMainWindow];
@@ -276,10 +276,6 @@ NSTimeInterval kHideStatusDuration = 0.3;
NSDivideRect(drawFrame, &dropdownDrawRect, &buttonDrawRect,
kDropdownAreaWidth, NSMaxXEdge);
- NSRect buttonInnerRect, dropdownInnerRect;
- NSDivideRect(innerFrame, &dropdownInnerRect, &buttonInnerRect,
- kDropdownAreaWidth, NSMaxXEdge);
-
NSBezierPath* buttonInnerPath = [self
leftRoundedPath:radius inRect:buttonDrawRect];
NSBezierPath* buttonOuterPath = [self
@@ -292,27 +288,24 @@ NSTimeInterval kHideStatusDuration = 0.3;
rightRoundedPath:(radius + 1)
inRect:NSInsetRect(dropdownDrawRect, -1, -1)];
- // Stroke the borders and appropriate fill gradient. If we're borderless,
- // the only time we want to draw the inner gradient is if we're highlighted.
- if ([self isHighlighted] || [self isMouseInside]) {
- [self drawBorderAndFillForTheme:theme
- controlView:controlView
- outerPath:buttonOuterPath
- innerPath:buttonInnerPath
- showHighlightGradient:[self isMouseOverButtonPart]
- showClickedGradient:[self isButtonPartPressed]
- active:active
- cellFrame:cellFrame];
-
- [self drawBorderAndFillForTheme: theme
- controlView:controlView
- outerPath:dropdownOuterPath
- innerPath:dropdownInnerPath
- showHighlightGradient:[self isMouseOverDropdownPart]
- showClickedGradient:[self isDropdownPartPressed]
- active:active
- cellFrame:cellFrame];
- }
+ // Stroke the borders and appropriate fill gradient.
+ [self drawBorderAndFillForTheme:theme
+ controlView:controlView
+ outerPath:buttonOuterPath
+ innerPath:buttonInnerPath
+ showHighlightGradient:[self isMouseOverButtonPart]
+ showClickedGradient:[self isButtonPartPressed]
+ active:active
+ cellFrame:cellFrame];
+
+ [self drawBorderAndFillForTheme: theme
+ controlView:controlView
+ outerPath:dropdownOuterPath
+ innerPath:dropdownInnerPath
+ showHighlightGradient:[self isMouseOverDropdownPart]
+ showClickedGradient:[self isDropdownPartPressed]
+ active:active
+ cellFrame:cellFrame];
[self drawInteriorWithFrame:innerFrame inView:controlView];
}
@@ -364,7 +357,7 @@ NSTimeInterval kHideStatusDuration = 0.3;
// Popup arrow. Put center of mass of the arrow in the center of the
// dropdown area.
- CGFloat cx = NSMaxX(cellFrame) - kDropdownAreaWidth/2;
+ CGFloat cx = NSMaxX(cellFrame) - kDropdownAreaWidth/2 + 0.5;
CGFloat cy = NSMidY(cellFrame);
NSPoint p1 = NSMakePoint(cx - kDropdownArrowWidth/2,
cy - kDropdownArrowHeight/3);
diff --git a/chrome/browser/cocoa/download_shelf_controller.mm b/chrome/browser/cocoa/download_shelf_controller.mm
index c449c98..0219b56 100644
--- a/chrome/browser/cocoa/download_shelf_controller.mm
+++ b/chrome/browser/cocoa/download_shelf_controller.mm
@@ -21,11 +21,8 @@ namespace {
// we already have this many download views, one is removed.
const size_t kMaxDownloadItemCount = 16;
-// Border padding of a download item.
-const int kDownloadItemBorderPadding = 3;
-
// Horizontal padding between two download items.
-const int kDownloadItemPadding = 10;
+const int kDownloadItemPadding = 2;
// Duration for the open-new-leftmost-item animation, in seconds.
const NSTimeInterval kDownloadItemOpenDuration = 0.8;
@@ -231,7 +228,7 @@ const NSTimeInterval kDownloadItemOpenDuration = 0.8;
// Start at width 0...
NSSize size = [controller.get() preferredSize];
- NSRect frame = NSMakeRect(0, kDownloadItemBorderPadding, 0, size.height);
+ NSRect frame = NSMakeRect(0, 0, 0, size.height);
[[controller.get() view] setFrame:frame];
// ...then animate in