OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #import "chrome/browser/bookmarks/bookmark_model.h" | 9 #import "chrome/browser/bookmarks/bookmark_model.h" |
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 [self setBezelStyle:NSShadowlessSquareBezelStyle]; | 84 [self setBezelStyle:NSShadowlessSquareBezelStyle]; |
85 [self setShowsBorderOnlyWhileMouseInside:YES]; | 85 [self setShowsBorderOnlyWhileMouseInside:YES]; |
86 [self setControlSize:NSSmallControlSize]; | 86 [self setControlSize:NSSmallControlSize]; |
87 [self setAlignment:NSLeftTextAlignment]; | 87 [self setAlignment:NSLeftTextAlignment]; |
88 [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; | 88 [self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]]; |
89 [self setWraps:NO]; | 89 [self setWraps:NO]; |
90 // NSLineBreakByTruncatingMiddle seems more common on OSX but let's | 90 // NSLineBreakByTruncatingMiddle seems more common on OSX but let's |
91 // try to match Windows for a bit to see what happens. | 91 // try to match Windows for a bit to see what happens. |
92 [self setLineBreakMode:NSLineBreakByTruncatingTail]; | 92 [self setLineBreakMode:NSLineBreakByTruncatingTail]; |
93 | 93 |
| 94 // The overflow button chevron bitmap is not 16 units high, so it'd be scaled |
| 95 // at paint time without this. |
| 96 [self setImageScaling:NSImageScaleNone]; |
| 97 |
94 // Theming doesn't work for bookmark buttons yet (cell text is chucked). | 98 // Theming doesn't work for bookmark buttons yet (cell text is chucked). |
95 [super setShouldTheme:NO]; | 99 [super setShouldTheme:NO]; |
96 } | 100 } |
97 | 101 |
98 - (BOOL)empty { | 102 - (BOOL)empty { |
99 return empty_; | 103 return empty_; |
100 } | 104 } |
101 | 105 |
102 - (void)setEmpty:(BOOL)empty { | 106 - (void)setEmpty:(BOOL)empty { |
103 empty_ = empty; | 107 empty_ = empty; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 respectFlipped:YES | 263 respectFlipped:YES |
260 hints:nil]; | 264 hints:nil]; |
261 } | 265 } |
262 } | 266 } |
263 | 267 |
264 - (int)verticalTextOffset { | 268 - (int)verticalTextOffset { |
265 return 0; | 269 return 0; |
266 } | 270 } |
267 | 271 |
268 @end | 272 @end |
OLD | NEW |