[Mac] Fix "empty" item position when BMB folder becomes empty.

Fixed at altitude 12000 meters.

BUG=227391
TEST=See bug.

Review URL: https://chromiumcodereview.appspot.com/23591052

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223498 0039d316-1c4b-4281-b951-d872f2087c98
parent 7008c98e
......@@ -108,6 +108,13 @@ struct LayoutMetrics {
folderTop(0.0) {}
};
NSRect GetFirstButtonFrameForHeight(CGFloat height) {
CGFloat y = height - bookmarks::kBookmarkFolderButtonHeight -
bookmarks::kBookmarkVerticalPadding;
return NSMakeRect(0, y, bookmarks::kDefaultBookmarkWidth,
bookmarks::kBookmarkFolderButtonHeight);
}
} // namespace
......@@ -786,12 +793,7 @@ struct LayoutMetrics {
// TODO(jrg): combine with frame code in bookmark_bar_controller.mm
// http://crbug.com/35966
NSRect buttonsOuterFrame = NSMakeRect(
0,
height - bookmarks::kBookmarkFolderButtonHeight -
bookmarks::kBookmarkVerticalPadding,
bookmarks::kDefaultBookmarkWidth,
bookmarks::kBookmarkFolderButtonHeight);
NSRect buttonsOuterFrame = GetFirstButtonFrameForHeight(height);
// TODO(jrg): combine with addNodesToButtonList: code from
// bookmark_bar_controller.mm (but use y offset)
......@@ -1917,8 +1919,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// If all nodes have been removed from this folder then add in the
// 'empty' placeholder button.
NSRect buttonFrame =
NSMakeRect(0.0, 0.0, bookmarks::kDefaultBookmarkWidth,
bookmarks::kBookmarkFolderButtonHeight);
GetFirstButtonFrameForHeight([self menuHeightForButtonCount:1]);
BookmarkButton* button = [self makeButtonForNode:nil
frame:buttonFrame];
[buttons_ addObject:button];
......
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