diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 22:52:41 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-27 22:52:41 +0000 |
commit | 6d66b7427180321470900d3d58ad63d4ea6df082 (patch) | |
tree | 20e5bc57106280306cf5e5c638b6523ec79232f3 | |
parent | b9ebebaa0028104f11968d0ed2755411ee3458e0 (diff) | |
download | chromium_src-6d66b7427180321470900d3d58ad63d4ea6df082.zip chromium_src-6d66b7427180321470900d3d58ad63d4ea6df082.tar.gz chromium_src-6d66b7427180321470900d3d58ad63d4ea6df082.tar.bz2 |
Fix download shelf item overflow on os x.
This was regressed by the subview layout refactoring.
BUG=14672
TEST=download several items, resize window, make sure that no download item ever overlaps the "Show all downloads" link on the right.
Review URL: http://codereview.chromium.org/173048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24683 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/download_shelf_controller.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/download_shelf_controller.mm b/chrome/browser/cocoa/download_shelf_controller.mm index 73b2af5..a2fba89 100644 --- a/chrome/browser/cocoa/download_shelf_controller.mm +++ b/chrome/browser/cocoa/download_shelf_controller.mm @@ -48,13 +48,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; |