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

Unified Diff: chrome/browser/cocoa/autocomplete_text_field_cell.mm

Issue 181011: [Mac] Make I-beam cursor match editing area. (Closed)
Patch Set: Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.mm b/chrome/browser/cocoa/autocomplete_text_field_cell.mm
index d4ef0fe101edd57c19712f107f10c18f80823495..7125774a0cbda6c3896d8f2bce03e9bd895ce257 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_cell.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell.mm
@@ -191,8 +191,12 @@ const NSInteger kBaselineOffset = 4;
[self drawInteriorWithFrame:cellFrame inView:controlView];
}
+- (NSRect)textCursorFrameForFrame:(NSRect)cellFrame {
+ return NSInsetRect(cellFrame, 0, kBaselineAdjust);
+}
+
- (NSRect)textFrameForFrame:(NSRect)cellFrame {
- NSRect textFrame(cellFrame);
+ NSRect textFrame([self textCursorFrameForFrame:cellFrame]);
if (hintString_) {
DCHECK(!keywordString_);
@@ -217,7 +221,7 @@ const NSInteger kBaselineOffset = 4;
}
}
- return NSInsetRect(textFrame, 0, kBaselineAdjust);
+ return textFrame;
}
- (void)drawHintWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
@@ -300,4 +304,9 @@ const NSInteger kBaselineOffset = 4;
length:selLength];
}
+- (void)resetCursorRect:(NSRect)cellFrame inView:(NSView *)controlView {
+ [super resetCursorRect:[self textCursorFrameForFrame:cellFrame]
+ inView:controlView];
+}
+
@end
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell.h ('k') | chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698