Commit 643ffcf2 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][DarkMode] Remove inactive tab line separator

Bug: 976817
Change-Id: Ie3669f79226a0e85896923365b3fb32b73ea5ec1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1706851Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678602}
parent 84ad1071
...@@ -69,9 +69,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -69,9 +69,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
// Background image for this tab. // Background image for this tab.
UIImageView* _backgroundImageView; UIImageView* _backgroundImageView;
// This view is used to draw a separator line at the bottom of the tab view.
// This view is hidden when the tab view is in a selected state.
UIView* _lineSeparator;
BOOL _incognitoStyle; BOOL _incognitoStyle;
// Set to YES when the layout constraints have been initialized. // Set to YES when the layout constraints have been initialized.
...@@ -94,9 +91,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -94,9 +91,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
// Creates the close button, favicon button, and title. // Creates the close button, favicon button, and title.
- (void)createButtonsAndLabel; - (void)createButtonsAndLabel;
// Updates this tab's line separator color based on the current incognito style.
- (void)updateLineSeparator;
// Updates this tab's background image based on the value of |selected|. // Updates this tab's background image based on the value of |selected|.
- (void)updateBackgroundImage:(BOOL)selected; - (void)updateBackgroundImage:(BOOL)selected;
...@@ -119,12 +113,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -119,12 +113,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
@implementation TabView @implementation TabView
@synthesize delegate = _delegate;
@synthesize titleLabel = _titleLabel;
@synthesize collapsed = _collapsed;
@synthesize background = background_;
@synthesize incognitoStyle = _incognitoStyle;
- (id)initWithEmptyView:(BOOL)emptyView selected:(BOOL)selected { - (id)initWithEmptyView:(BOOL)emptyView selected:(BOOL)selected {
if ((self = [super initWithFrame:CGRectZero])) { if ((self = [super initWithFrame:CGRectZero])) {
[self setOpaque:NO]; [self setOpaque:NO];
...@@ -133,7 +121,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -133,7 +121,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
// changes. |isSelected| defaults to NO, so if |selected| is also NO, // changes. |isSelected| defaults to NO, so if |selected| is also NO,
// -updateBackgroundImage needs to be called explicitly. // -updateBackgroundImage needs to be called explicitly.
[self setSelected:selected]; [self setSelected:selected];
[self updateLineSeparator];
[self updateBackgroundImage:selected]; [self updateBackgroundImage:selected];
if (!emptyView) if (!emptyView)
[self createButtonsAndLabel]; [self createButtonsAndLabel];
...@@ -155,8 +142,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -155,8 +142,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
BOOL wasSelected = [self isSelected]; BOOL wasSelected = [self isSelected];
[super setSelected:selected]; [super setSelected:selected];
[_lineSeparator setHidden:selected];
if (selected != wasSelected) if (selected != wasSelected)
[self updateBackgroundImage:selected]; [self updateBackgroundImage:selected];
...@@ -202,7 +187,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -202,7 +187,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
_titleLabel.textColor = _titleLabel.textColor =
incognitoStyle ? [UIColor whiteColor] : [UIColor blackColor]; incognitoStyle ? [UIColor whiteColor] : [UIColor blackColor];
[_faviconView setImage:[self defaultFaviconImage]]; [_faviconView setImage:[self defaultFaviconImage]];
[self updateLineSeparator];
[self updateCloseButtonImages]; [self updateCloseButtonImages];
[self updateBackgroundImage:[self isSelected]]; [self updateBackgroundImage:[self isSelected]];
} }
...@@ -261,22 +245,15 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -261,22 +245,15 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
_backgroundImageView = [[UIImageView alloc] init]; _backgroundImageView = [[UIImageView alloc] init];
[_backgroundImageView setTranslatesAutoresizingMaskIntoConstraints:NO]; [_backgroundImageView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addSubview:_backgroundImageView]; [self addSubview:_backgroundImageView];
_lineSeparator = [[UIView alloc] initWithFrame:CGRectZero];
[_lineSeparator setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addSubview:_lineSeparator];
} }
- (void)addCommonConstraints { - (void)addCommonConstraints {
NSDictionary* commonViewsDictionary = @{ NSDictionary* commonViewsDictionary = @{
@"backgroundImageView" : _backgroundImageView, @"backgroundImageView" : _backgroundImageView,
@"lineSeparator" : _lineSeparator
}; };
NSArray* commonConstraints = @[ NSArray* commonConstraints = @[
@"H:|-0-[backgroundImageView]-0-|", @"H:|-0-[backgroundImageView]-0-|",
@"V:|-0-[backgroundImageView]-0-|", @"V:|-0-[backgroundImageView]-0-|",
@"H:|-tabStripLineMargin-[lineSeparator]-tabStripLineMargin-|",
@"V:[lineSeparator(==tabStripLineHeight)]-0-|",
]; ];
NSDictionary* commonMetrics = @{ NSDictionary* commonMetrics = @{
@"tabStripLineMargin" : @(kTabStripLineMargin), @"tabStripLineMargin" : @(kTabStripLineMargin),
...@@ -366,13 +343,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF; ...@@ -366,13 +343,6 @@ const int kTabCloseTintIncognito = 0xFFFFFF;
AddSameCenterYConstraint(self, _faviconView, _titleLabel); AddSameCenterYConstraint(self, _faviconView, _titleLabel);
} }
- (void)updateLineSeparator {
UIColor* separatorColor =
_incognitoStyle ? [UIColor colorWithWhite:36 / 255.0 alpha:1.0]
: [UIColor colorWithWhite:185 / 255.0 alpha:1.0];
[_lineSeparator setBackgroundColor:separatorColor];
}
- (void)updateBackgroundImage:(BOOL)selected { - (void)updateBackgroundImage:(BOOL)selected {
NSString* state = (selected ? @"foreground" : @"background"); NSString* state = (selected ? @"foreground" : @"background");
NSString* incognito = _incognitoStyle ? @"incognito_" : @""; NSString* incognito = _incognitoStyle ? @"incognito_" : @"";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment