Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1263)

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm

Issue 23591052: [Mac] Fix "empty" item position when BMB folder becomes empty. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
===================================================================
--- chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm (revision 222257)
+++ chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm (working copy)
@@ -108,6 +108,13 @@
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 @@
// 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 @@
// 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];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698