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

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

Issue 606593002: Move bookmark's folder menu upwards only when its parent button is moved (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 6 years, 2 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
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
index 2eb0880c5f79ed46df5d53ad068412a2a6691471..f894eb6ac76fd2263b9eb0aec5e139342dbdb9d5 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
@@ -1935,11 +1935,16 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
NSInteger buttonCount = [buttons_ count];
if (buttonCount) {
BookmarkButton* subButton = [folderController_ parentButton];
+ NSInteger targetIndex = 0;
for (NSButton* aButton in buttons_.get()) {
- // If this button is showing its menu then we need to move the menu, too.
- if (aButton == subButton)
- [folderController_
- offsetFolderMenuWindow:NSMakeSize(0.0, chrome::kBookmarkBarHeight)];
+ targetIndex++;
+ // If this button is showing its menu and is below the removed button,
+ // i.e its index is greater, then we need to move the menu too.
+ if (aButton == subButton && targetIndex > buttonIndex) {
+ [folderController_ offsetFolderMenuWindow:NSMakeSize(0.0,
+ bookmarks::kBookmarkFolderButtonHeight)];
+ break;
Gaja 2014/10/07 04:39:12 Is it okay to break the loop once we found the but
+ }
}
} else if (parentButton_ != [barController_ otherBookmarksButton]) {
// If all nodes have been removed from this folder then add in the
« 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