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

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

Issue 8792001: A BookmarkBarFolderButtonCell should have the favicon aligned left when no title is provided (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: ASSERTS on pointers Created 9 years 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 | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_unittest.mm ('k') | 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_button_cell.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
index 392c7ca623d000ad1e3d3cd9f8c08cbf94c51ff2..e5985b9509d297ba7224aed7cd939849899e34e6 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -118,12 +118,19 @@
withString:@" "];
title = [title stringByReplacingOccurrencesOfString:@"\r"
withString:@" "];
- // If there is no title, squeeze things tight by displaying only the image; by
- // default, Cocoa leaves extra space in an attempt to display an empty title.
+
if ([title length]) {
[self setImagePosition:NSImageLeft];
[self setTitle:title];
+ } else if ([self isFolderButtonCell]) {
+ // Left-align icons for bookmarks within folders, regardless of whether
+ // there is a title.
+ [self setImagePosition:NSImageLeft];
} else {
+ // For bookmarks without a title that aren't visible directly in the
+ // bookmarks bar, squeeze things tighter by displaying only the image.
+ // By default, Cocoa leaves extra space in an attempt to display an
+ // empty title.
[self setImagePosition:NSImageOnly];
}
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_button_cell_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698