Commit 18d59bf7 authored by avi@chromium.org's avatar avi@chromium.org

Quick fix for window sizing under resolution independence on Mac. Scrolling...

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
parent 6388155e
......@@ -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];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment