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