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

Side by Side Diff: ios/chrome/browser/ui/infobars/infobar_view.mm

Issue 2659613002: Prevent infobar buttons title color from changing when disabled (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ios/chrome/browser/ui/infobars/infobar_view.h" 5 #import "ios/chrome/browser/ui/infobars/infobar_view.h"
6 6
7 #import <CoreGraphics/CoreGraphics.h> 7 #import <CoreGraphics/CoreGraphics.h>
8 #import <QuartzCore/QuartzCore.h> 8 #import <QuartzCore/QuartzCore.h>
9 9
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 tag:(NSInteger)tag 869 tag:(NSInteger)tag
870 target:(id)target 870 target:(id)target
871 action:(SEL)action { 871 action:(SEL)action {
872 base::scoped_nsobject<MDCFlatButton> button([[MDCFlatButton alloc] init]); 872 base::scoped_nsobject<MDCFlatButton> button([[MDCFlatButton alloc] init]);
873 button.get().inkColor = [[palette tint300] colorWithAlphaComponent:0.5f]; 873 button.get().inkColor = [[palette tint300] colorWithAlphaComponent:0.5f];
874 [button setBackgroundColor:[palette tint500] forState:UIControlStateNormal]; 874 [button setBackgroundColor:[palette tint500] forState:UIControlStateNormal];
875 [button setBackgroundColor:[UIColor colorWithWhite:0.8f alpha:1.0f] 875 [button setBackgroundColor:[UIColor colorWithWhite:0.8f alpha:1.0f]
876 forState:UIControlStateDisabled]; 876 forState:UIControlStateDisabled];
877 if (palette) 877 if (palette)
878 button.get().hasOpaqueBackground = YES; 878 button.get().hasOpaqueBackground = YES;
879 if (customTitleColor) 879 if (customTitleColor) {
880 button.get().tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
880 button.get().customTitleColor = customTitleColor; 881 button.get().customTitleColor = customTitleColor;
882 }
881 button.get().titleLabel.adjustsFontSizeToFitWidth = YES; 883 button.get().titleLabel.adjustsFontSizeToFitWidth = YES;
882 button.get().titleLabel.minimumScaleFactor = 0.6f; 884 button.get().titleLabel.minimumScaleFactor = 0.6f;
883 [button setTitle:message forState:UIControlStateNormal]; 885 [button setTitle:message forState:UIControlStateNormal];
884 [button setTag:tag]; 886 [button setTag:tag];
885 [button addTarget:target 887 [button addTarget:target
886 action:action 888 action:action
887 forControlEvents:UIControlEventTouchUpInside]; 889 forControlEvents:UIControlEventTouchUpInside];
888 // Without the call to layoutIfNeeded, |button| returns an incorrect 890 // Without the call to layoutIfNeeded, |button| returns an incorrect
889 // titleLabel the first time it is accessed in |narrowestWidthOfButton|. 891 // titleLabel the first time it is accessed in |narrowestWidthOfButton|.
890 [button layoutIfNeeded]; 892 [button layoutIfNeeded];
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 945
944 - (CGFloat)buttonMargin { 946 - (CGFloat)buttonMargin {
945 return kButtonMargin; 947 return kButtonMargin;
946 } 948 }
947 949
948 - (const std::vector<std::pair<NSUInteger, NSRange>>&)linkRanges { 950 - (const std::vector<std::pair<NSUInteger, NSRange>>&)linkRanges {
949 return linkRanges_; 951 return linkRanges_;
950 } 952 }
951 953
952 @end 954 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698