Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #import "chrome/browser/cocoa/hyperlink_button_cell.h" | 5 #import "chrome/browser/cocoa/hyperlink_button_cell.h" |
| 6 | 6 |
| 7 @interface HyperlinkButtonCell (Private) | 7 @interface HyperlinkButtonCell (Private) |
| 8 - (NSDictionary*)linkAttributres; | 8 - (NSDictionary*)linkAttributres; |
| 9 - (void)customizeButtonCell; | 9 - (void)customizeButtonCell; |
| 10 @end | 10 @end |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 [self setHighlightsBy:NSNoCellMask]; | 55 [self setHighlightsBy:NSNoCellMask]; |
| 56 | 56 |
| 57 // We need to set this so that we can override |-mouseEntered:| and | 57 // We need to set this so that we can override |-mouseEntered:| and |
| 58 // |-mouseExited:| to change the cursor style on hover states. | 58 // |-mouseExited:| to change the cursor style on hover states. |
| 59 [self setShowsBorderOnlyWhileMouseInside:YES]; | 59 [self setShowsBorderOnlyWhileMouseInside:YES]; |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Creates the NSDictionary of attributes for the attributed string. | 62 // Creates the NSDictionary of attributes for the attributed string. |
| 63 - (NSDictionary*)linkAttributes { | 63 - (NSDictionary*)linkAttributes { |
| 64 NSUInteger underlineMask = NSUnderlinePatternSolid | NSUnderlineStyleSingle; | 64 NSUInteger underlineMask = NSUnderlinePatternSolid | NSUnderlineStyleSingle; |
| 65 NSMutableParagraphStyle* paragraphStyle = | 65 NSMutableParagraphStyle* paragraphStyle = |
|
pink (ping after 24hrs)
2009/11/11 17:00:33
the best (and more consistent) fix here would be t
| |
| 66 [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; | 66 [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; |
| 67 [paragraphStyle setAlignment:[self alignment]]; | 67 [paragraphStyle setAlignment:[self alignment]]; |
| 68 | 68 |
| 69 return [NSDictionary dictionaryWithObjectsAndKeys: | 69 return [NSDictionary dictionaryWithObjectsAndKeys: |
| 70 [self textColor], NSForegroundColorAttributeName, | 70 [self textColor], NSForegroundColorAttributeName, |
| 71 [NSNumber numberWithInt:underlineMask], NSUnderlineStyleAttributeName, | 71 [NSNumber numberWithInt:underlineMask], NSUnderlineStyleAttributeName, |
| 72 [self font], NSFontAttributeName, | 72 [self font], NSFontAttributeName, |
| 73 [NSCursor pointingHandCursor], NSCursorAttributeName, | 73 [NSCursor pointingHandCursor], NSCursorAttributeName, |
| 74 paragraphStyle, NSParagraphStyleAttributeName, | 74 paragraphStyle, NSParagraphStyleAttributeName, |
| 75 nil | 75 nil |
| 76 ]; | 76 ]; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 100 // Setters and getters. | 100 // Setters and getters. |
| 101 - (NSColor*)textColor { | 101 - (NSColor*)textColor { |
| 102 return textColor_.get(); | 102 return textColor_.get(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 - (void)setTextColor:(NSColor*)color { | 105 - (void)setTextColor:(NSColor*)color { |
| 106 textColor_.reset([color retain]); | 106 textColor_.reset([color retain]); |
| 107 } | 107 } |
| 108 | 108 |
| 109 @end | 109 @end |
| OLD | NEW |