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

Side by Side Diff: chrome/browser/cocoa/bookmark_button_cell.mm

Issue 842005: Bookmark bar menu/folder button text is left-aligned, not centered.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #import "chrome/browser/cocoa/bookmark_button_cell.h" 6 #import "chrome/browser/cocoa/bookmark_button_cell.h"
7 #import "chrome/browser/cocoa/bookmark_menu.h" 7 #import "chrome/browser/cocoa/bookmark_menu.h"
8 8
9 @implementation BookmarkButtonCell 9 @implementation BookmarkButtonCell
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // TODO(jrg): consider placing in GTM. 91 // TODO(jrg): consider placing in GTM.
92 - (void)setTextColor:(NSColor*)color { 92 - (void)setTextColor:(NSColor*)color {
93 93
94 // We can't properly set the cell's text color without a control. 94 // We can't properly set the cell's text color without a control.
95 // In theory we could just save the next for later and wait until 95 // In theory we could just save the next for later and wait until
96 // the cell is moved to a control, but there is no obvious way to 96 // the cell is moved to a control, but there is no obvious way to
97 // accomplish that (e.g. no "cellDidMoveToControl" notification.) 97 // accomplish that (e.g. no "cellDidMoveToControl" notification.)
98 DCHECK([self controlView]); 98 DCHECK([self controlView]);
99 99
100 scoped_nsobject<NSMutableParagraphStyle> style([NSMutableParagraphStyle new]); 100 scoped_nsobject<NSMutableParagraphStyle> style([NSMutableParagraphStyle new]);
101 [style setAlignment:NSCenterTextAlignment]; 101 [style setAlignment:NSLeftTextAlignment];
102 NSDictionary* dict = [NSDictionary 102 NSDictionary* dict = [NSDictionary
103 dictionaryWithObjectsAndKeys:color, 103 dictionaryWithObjectsAndKeys:color,
104 NSForegroundColorAttributeName, 104 NSForegroundColorAttributeName,
105 [self font], NSFontAttributeName, 105 [self font], NSFontAttributeName,
106 style.get(), NSParagraphStyleAttributeName, 106 style.get(), NSParagraphStyleAttributeName,
107 nil]; 107 nil];
108 scoped_nsobject<NSAttributedString> ats([[NSAttributedString alloc] 108 scoped_nsobject<NSAttributedString> ats([[NSAttributedString alloc]
109 initWithString:[self title] 109 initWithString:[self title]
110 attributes:dict]); 110 attributes:dict]);
111 NSButton* button = static_cast<NSButton*>([self controlView]); 111 NSButton* button = static_cast<NSButton*>([self controlView]);
(...skipping 11 matching lines...) Expand all
123 [[self controlView] mouseEntered:event]; 123 [[self controlView] mouseEntered:event];
124 } 124 }
125 125
126 // See comment above mouseEntered:, above. 126 // See comment above mouseEntered:, above.
127 - (void)mouseExited:(NSEvent*)event { 127 - (void)mouseExited:(NSEvent*)event {
128 [super mouseExited:event]; 128 [super mouseExited:event];
129 [[self controlView] mouseExited:event]; 129 [[self controlView] mouseExited:event];
130 } 130 }
131 131
132 @end 132 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698