OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/fancy_ui/primary_action_button.h" |
| 6 |
| 7 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" |
| 8 |
| 9 @implementation PrimaryActionButton |
| 10 |
| 11 - (id)initWithFrame:(CGRect)frame { |
| 12 self = [super initWithFrame:frame]; |
| 13 if (self) |
| 14 [self initializeStyling]; |
| 15 return self; |
| 16 } |
| 17 |
| 18 - (id)initWithCoder:(NSCoder*)aDecoder { |
| 19 self = [super initWithCoder:aDecoder]; |
| 20 if (self) |
| 21 [self initializeStyling]; |
| 22 return self; |
| 23 } |
| 24 |
| 25 - (void)awakeFromNib { |
| 26 [super awakeFromNib]; |
| 27 [self initializeStyling]; |
| 28 } |
| 29 |
| 30 - (void)initializeStyling { |
| 31 self.hasOpaqueBackground = YES; |
| 32 self.underlyingColorHint = [UIColor whiteColor]; |
| 33 self.inkColor = |
| 34 [[[MDCPalette cr_bluePalette] tint300] colorWithAlphaComponent:0.5f]; |
| 35 [self setBackgroundColor:[[MDCPalette cr_bluePalette] tint500] |
| 36 forState:UIControlStateNormal]; |
| 37 [self setBackgroundColor:[UIColor colorWithWhite:0.6f alpha:1.0f] |
| 38 forState:UIControlStateDisabled]; |
| 39 self.customTitleColor = [UIColor whiteColor]; |
| 40 } |
| 41 |
| 42 @end |
OLD | NEW |