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

Unified Diff: chrome/browser/ui/cocoa/passwords/credential_item_button.mm

Issue 2259533006: Tune the account chooser on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/passwords/credential_item_button.mm
diff --git a/chrome/browser/ui/cocoa/passwords/credential_item_button.mm b/chrome/browser/ui/cocoa/passwords/credential_item_button.mm
index 8002f630cae14134bc5522b503e97b4ac5ffaedf..c8080bfb44e571335ed4be2f9b953e71cf37f9ec 100644
--- a/chrome/browser/ui/cocoa/passwords/credential_item_button.mm
+++ b/chrome/browser/ui/cocoa/passwords/credential_item_button.mm
@@ -16,7 +16,7 @@
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
namespace {
-constexpr CGFloat kFocusRingLineWidth = 2;
+constexpr CGFloat kFocusRingInset = 3;
constexpr CGFloat kHorizontalPaddingBetweenAvatarAndLabel = 10;
} // namespace
@@ -74,25 +74,14 @@ constexpr CGFloat kHorizontalPaddingBetweenAvatarAndLabel = 10;
return buttonSize;
}
-- (NSFocusRingType)focusRingType {
- // This is taken care of by the custom drawing code.
- return NSFocusRingTypeNone;
-}
+- (void)drawFocusRingMaskWithFrame:(NSRect)cellFrame
+ inView:(NSView *)controlView {
+ NSRect focusRingRect =
+ NSInsetRect(cellFrame, kFocusRingInset, kFocusRingInset);
-- (void)drawWithFrame:(NSRect)frame inView:(NSView*)controlView {
- [super drawInteriorWithFrame:frame inView:controlView];
-
- // Focus ring.
- if ([self showsFirstResponder]) {
- NSRect focusRingRect =
- NSInsetRect(frame, kFocusRingLineWidth, kFocusRingLineWidth);
- // TODO(vasilii): When we are targetting 10.7, we should change this to use
- // -drawFocusRingMaskWithFrame instead.
- [[[NSColor keyboardFocusIndicatorColor] colorWithAlphaComponent:1] set];
- NSBezierPath* path = [NSBezierPath bezierPathWithRect:focusRingRect];
- [path setLineWidth:kFocusRingLineWidth];
- [path stroke];
- }
+ [[NSBezierPath bezierPathWithRoundedRect:focusRingRect
+ xRadius:2
+ yRadius:2] fill];
}
@end
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698