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

Side by Side Diff: ios/chrome/browser/ui/reading_list/reading_list_toolbar.mm

Issue 2707753003: Shrink to fit the label on ReadingListToolbar (Closed)
Patch Set: Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/reading_list/reading_list_toolbar.h" 5 #import "ios/chrome/browser/ui/reading_list/reading_list_toolbar.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" 8 #import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h"
9 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" 9 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
10 #include "ios/chrome/browser/ui/rtl_geometry.h" 10 #include "ios/chrome/browser/ui/rtl_geometry.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 [self setMarkButtonText:l10n_util::GetNSStringWithFixup( 230 [self setMarkButtonText:l10n_util::GetNSStringWithFixup(
231 IDS_IOS_READING_LIST_MARK_BUTTON)]; 231 IDS_IOS_READING_LIST_MARK_BUTTON)];
232 } 232 }
233 233
234 - (UIButton*)buttonWithText:(NSString*)title 234 - (UIButton*)buttonWithText:(NSString*)title
235 destructive:(BOOL)isDestructive 235 destructive:(BOOL)isDestructive
236 positioning:(ButtonPositioning)position { 236 positioning:(ButtonPositioning)position {
237 UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; 237 UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
238 button.contentEdgeInsets = UIEdgeInsetsMake(0, 8, 0, 8); 238 button.contentEdgeInsets = UIEdgeInsetsMake(0, 8, 0, 8);
239 [button setTitle:title forState:UIControlStateNormal]; 239 [button setTitle:title forState:UIControlStateNormal];
240 button.titleLabel.numberOfLines = 0; 240 button.titleLabel.numberOfLines = 3;
241 button.titleLabel.adjustsFontSizeToFitWidth = YES;
241 242
242 button.backgroundColor = [UIColor whiteColor]; 243 button.backgroundColor = [UIColor whiteColor];
243 UIColor* textColor = isDestructive ? [[MDCPalette cr_redPalette] tint500] 244 UIColor* textColor = isDestructive ? [[MDCPalette cr_redPalette] tint500]
244 : [[MDCPalette cr_bluePalette] tint500]; 245 : [[MDCPalette cr_bluePalette] tint500];
245 [button setTitleColor:textColor forState:UIControlStateNormal]; 246 [button setTitleColor:textColor forState:UIControlStateNormal];
246 [button setTitleColor:[UIColor lightGrayColor] 247 [button setTitleColor:[UIColor lightGrayColor]
247 forState:UIControlStateDisabled]; 248 forState:UIControlStateDisabled];
248 [button setTitleColor:[textColor colorWithAlphaComponent:0.3] 249 [button setTitleColor:[textColor colorWithAlphaComponent:0.3]
249 forState:UIControlStateHighlighted]; 250 forState:UIControlStateHighlighted];
250 [[button titleLabel] 251 [[button titleLabel]
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 16) { 298 16) {
298 [self.heightDelegate toolbar:self onHeightChanged:ExpandedHeight]; 299 [self.heightDelegate toolbar:self onHeightChanged:ExpandedHeight];
299 return; 300 return;
300 } 301 }
301 } 302 }
302 } 303 }
303 [self.heightDelegate toolbar:self onHeightChanged:NormalHeight]; 304 [self.heightDelegate toolbar:self onHeightChanged:NormalHeight];
304 } 305 }
305 306
306 @end 307 @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