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

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

Issue 3042014: Conditionally draw a bezel below text fields, used for the omnibox.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « chrome/browser/cocoa/styled_text_field_cell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/styled_text_field_cell.mm
===================================================================
--- chrome/browser/cocoa/styled_text_field_cell.mm (revision 53182)
+++ chrome/browser/cocoa/styled_text_field_cell.mm (working copy)
@@ -85,6 +85,10 @@
return 0.0;
}
+- (BOOL)shouldDrawBezel {
+ return NO;
+}
+
// Returns the same value as textCursorFrameForFrame, but does not call it
// directly to avoid potential infinite loops.
- (NSRect)textFrameForFrame:(NSRect)cellFrame {
@@ -166,6 +170,17 @@
FrameRectWithInset(shadowFrame, 0.5, radius - 0.5, 1.0, shadowShade);
}
+ // Draw optional bezel below bottom stroke.
+ if ([self shouldDrawBezel]) {
+ [[NSColor colorWithCalibratedWhite:0.96 alpha:1.0] set];
+ NSRect bezelRect = NSMakeRect(cellFrame.origin.x,
+ NSMaxY(cellFrame) - 0.5,
+ NSWidth(cellFrame),
+ 1.0);
+ bezelRect = NSInsetRect(bezelRect, radius - 0.5, 0.0);
+ NSFrameRect(bezelRect);
+ }
+
// Draw the focus ring if needed.
if ([self showsFirstResponder]) {
NSColor* color =
« no previous file with comments | « chrome/browser/cocoa/styled_text_field_cell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698