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

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: handle nits; add unit test 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..cffe29f777acca3670ba164dc68343e9e983d0e5 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
@@ -114,16 +114,16 @@
- (void)setBookmarkCellText:(NSString*)title
image:(NSImage*)image {
- title = [title stringByReplacingOccurrencesOfString:@"\n"
- withString:@" "];
- title = [title stringByReplacingOccurrencesOfString:@"\r"
- withString:@" "];
Ilya Sherman 2011/12/13 22:35:24 nit: For the sake of clarity when scanning the rev
KushalP 2011/12/13 22:51:31 As in a completely different commit to the repo? S
- // 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 {
+ // Only show the icon when there is no title and the cell is on the
+ // bookmarks bar (directly) and not in a folder.
Ilya Sherman 2011/12/13 22:35:24 nit: This comment is a little confusing, because i
[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