Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1340)

Unified Diff: chrome/browser/cocoa/download_shelf_controller.mm

Issue 173048: Fix download shelf item overflow on os x. (Closed)
Patch Set: epic fail Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/download_shelf_controller.mm
diff --git a/chrome/browser/cocoa/download_shelf_controller.mm b/chrome/browser/cocoa/download_shelf_controller.mm
index c9448d6378e96c665468bc026fbdf78edf528abe..29f909c355e7e3883068d40a7464938b23b7755a 100644
--- a/chrome/browser/cocoa/download_shelf_controller.mm
+++ b/chrome/browser/cocoa/download_shelf_controller.mm
@@ -46,13 +46,17 @@ const NSTimeInterval kDownloadItemOpenDuration = 0.8;
resizeDelegate_ = resizeDelegate;
shelfHeight_ = [[self view] bounds].size.height;
- // Reset the download shelf's frame to zero. It will be properly positioned
- // and sized the first time we try to set its height.
- [[self view] setFrame:NSZeroRect];
+ // Reset the download shelf's frame height to zero. It will be properly
+ // positioned and sized the first time we try to set its height. (Just
+ // setting the rect to NSZeroRect does not work: it confuses Cocoa's view
+ // layout logic. If the shelf's width is too small, cocoa makes the download
+ // item container view wider than the browser window).
+ NSRect frame = [[self view] frame];
+ frame.size.height = 0;
+ [[self view] setFrame:frame];
downloadItemControllers_.reset([[NSMutableArray alloc] init]);
- // This calls show:, so it needs to be last.
bridge_.reset(new DownloadShelfMac(browser, self));
}
return self;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698