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

Unified Diff: ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm

Issue 2880803002: [ios clean] Toolbar UI improvements. (Closed)
Patch Set: Creates ToolbarConstants file Created 3 years, 7 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 | « ios/clean/chrome/browser/ui/toolbar/toolbar_constants.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm
diff --git a/ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm b/ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm
index 7511cfdd6348a4448001cce73e8c017e953fc538..544f2a153cb02550e2c163f3453ba000b757fcdb 100644
--- a/ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm
+++ b/ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm
@@ -11,21 +11,13 @@
#import "ios/clean/chrome/browser/ui/commands/tools_menu_commands.h"
#import "ios/clean/chrome/browser/ui/toolbar/toolbar_button+factory.h"
#import "ios/clean/chrome/browser/ui/toolbar/toolbar_component_options.h"
+#import "ios/clean/chrome/browser/ui/toolbar/toolbar_constants.h"
#import "ios/third_party/material_components_ios/src/components/ProgressView/src/MaterialProgressView.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
-namespace {
-// Stackview Vertical Margin.
-CGFloat kVerticalMargin = 5.0f;
-// Stackview Horizontal Margin.
-CGFloat kHorizontalMargin = 8.0f;
-// Progress Bar Height.
-CGFloat kProgressBarHeight = 2.0f;
-} // namespace
-
@interface ToolbarViewController ()
@property(nonatomic, strong) UIView* locationBarContainer;
@property(nonatomic, strong) UIStackView* stackView;
@@ -68,7 +60,10 @@ CGFloat kProgressBarHeight = 2.0f;
#pragma mark - View lifecyle
- (void)viewDidLoad {
- self.view.backgroundColor = [UIColor lightGrayColor];
+ self.view.backgroundColor =
+ [UIColor colorWithWhite:kToolbarBackgroundBrightness alpha:1.0];
+ self.view.tintColor =
+ [UIColor colorWithWhite:kToolbarTintColorBrightness alpha:1.0];
[self addChildViewController:self.locationBarViewController
toSubview:self.locationBarContainer];
[self setUpToolbarStackView];
@@ -87,7 +82,7 @@ CGFloat kProgressBarHeight = 2.0f;
self.tabSwitchGridButton, self.toolsMenuButton
]];
self.stackView.translatesAutoresizingMaskIntoConstraints = NO;
- self.stackView.spacing = 16.0;
+ self.stackView.spacing = kStackViewSpacing;
self.stackView.distribution = UIStackViewDistributionFill;
[self updateAllButtonsVisibility];
}
@@ -198,6 +193,14 @@ CGFloat kProgressBarHeight = 2.0f;
UIView* locationBarContainer = [[UIView alloc] initWithFrame:CGRectZero];
locationBarContainer.translatesAutoresizingMaskIntoConstraints = NO;
locationBarContainer.backgroundColor = [UIColor whiteColor];
+ locationBarContainer.layer.borderWidth = kLocationBarBorderWidth;
+ locationBarContainer.layer.borderColor =
+ [UIColor colorWithWhite:kLocationBarBorderColorBrightness alpha:1.0]
+ .CGColor;
+ locationBarContainer.layer.shadowRadius = kLocationBarShadowRadius;
+ locationBarContainer.layer.shadowOpacity = kLocationBarShadowOpacity;
+ locationBarContainer.layer.shadowOffset = CGSizeMake(0.0f, 0.5f);
+
[locationBarContainer
setContentHuggingPriority:UILayoutPriorityDefaultLow
forAxis:UILayoutConstraintAxisHorizontal];
« no previous file with comments | « ios/clean/chrome/browser/ui/toolbar/toolbar_constants.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698