diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 15:27:23 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 15:27:23 +0000 |
commit | 18d59bf78fef12541ef38b405f6c8d3582e9b8fd (patch) | |
tree | 23c38764b5e7e9dadc617d2f00c097645cb48dd2 | |
parent | 6388155e5f1d771c2b0975af7b86d7965712da8d (diff) | |
download | chromium_src-18d59bf78fef12541ef38b405f6c8d3582e9b8fd.zip chromium_src-18d59bf78fef12541ef38b405f6c8d3582e9b8fd.tar.gz chromium_src-18d59bf78fef12541ef38b405f6c8d3582e9b8fd.tar.bz2 |
Quick fix for window sizing under resolution independence on Mac. Scrolling and the "more" arrows are still broken, but this at least makes things usable.
Re-committing of r53272, but this time with more... correctness.
Original review: http://codereview.chromium.org/3029020
BUG=http://crbug.com/19476
TEST=run app under high-res, click bookmark bar button, see that the popup is sized to hold the buttons.
Review URL: http://codereview.chromium.org/3061021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53944 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_folder_controller.mm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm index c00c5aa..ff556df 100644 --- a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm @@ -377,16 +377,20 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; [self adjustButtonWidths] + (2 * bookmarks::kBookmarkVerticalPadding) + bookmarks::kScrollViewContentWidthMargin; NSPoint newWindowTopLeft = [self windowTopLeftForWidth:windowWidth]; + NSSize windowSize = [scrollView_ convertSize:NSMakeSize(windowWidth, + windowHeight) + toView:nil]; + newWindowTopLeft.y -= windowSize.height; NSRect windowFrame = NSMakeRect(newWindowTopLeft.x, - newWindowTopLeft.y - windowHeight, - windowWidth, - windowHeight); + newWindowTopLeft.y, + windowSize.width, + windowSize.height); // Make the scrolled content be the right size (full size). NSRect mainViewFrame = NSMakeRect(0, 0, - NSWidth(windowFrame) - + windowWidth - bookmarks::kScrollViewContentWidthMargin, - NSHeight(windowFrame)); + windowHeight); [mainView_ setFrame:mainViewFrame]; // Make sure the window fits on the screen. If not, constrain. @@ -404,8 +408,10 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; [window setFrame:windowFrame display:YES]; // If scrollable then offset the view and show the arrows. if (wasScrollable != scrollable_) { + NSSize windowLocalSize = [scrollView_ convertSize:windowFrame.size + fromView:nil]; [mainView_ scrollPoint:NSMakePoint(0, (NSHeight(mainViewFrame) - - NSHeight(windowFrame)))]; + windowLocalSize.height))]; [self showOrHideScrollArrows]; [self addOrUpdateScrollTracking]; } |