Skip to content

Commit

Permalink
Remove the kGridTitleHoverColor as it is the same as kGridTitleColor.
Browse files Browse the repository at this point in the history
This CL removes the hover text color constant from the app list since
the text color no longer changes on hover.

BUG=485393

Review URL: https://codereview.chromium.org/1123213007

Cr-Commit-Position: refs/heads/master@{#328708}
  • Loading branch information
nik3daz authored and Commit bot committed May 7, 2015
1 parent c15061e commit 9ae98d7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 26 deletions.
1 change: 0 additions & 1 deletion ui/app_list/app_list_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const SkColor kResultDimmedTextColor = SkColorSetRGB(0x84, 0x84, 0x84);
const SkColor kResultURLTextColor = SkColorSetRGB(0x00, 0x99, 0x33);

const SkColor kGridTitleColor = SkColorSetRGB(0x33, 0x33, 0x33);
const SkColor kGridTitleHoverColor = kGridTitleColor;

const SkColor kFolderTitleColor = SkColorSetRGB(0x33, 0x33, 0x33);
const SkColor kFolderTitleHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0);
Expand Down
1 change: 0 additions & 1 deletion ui/app_list/app_list_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ APP_LIST_EXPORT extern const SkColor kResultDimmedTextColor;
APP_LIST_EXPORT extern const SkColor kResultURLTextColor;

APP_LIST_EXPORT extern const SkColor kGridTitleColor;
APP_LIST_EXPORT extern const SkColor kGridTitleHoverColor;

APP_LIST_EXPORT extern const SkColor kFolderTitleColor;
APP_LIST_EXPORT extern const SkColor kFolderTitleHintTextColor;
Expand Down
16 changes: 0 additions & 16 deletions ui/app_list/cocoa/apps_grid_controller_unittest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -288,22 +288,6 @@ void SetMenuReadyForTesting(bool ready) {
EXPECT_EQ(1u, [[GetPageAt(0) content] count]);
}

// Tests that selecting an item changes the text color correctly.
TEST_F(AppsGridControllerTest, SelectionChangesTextColor) {
model()->PopulateApps(2);
[apps_grid_controller_ selectItemAtIndex:0];
EXPECT_NSEQ(ButtonTitleColorAt(0),
gfx::SkColorToSRGBNSColor(app_list::kGridTitleHoverColor));
EXPECT_NSEQ(ButtonTitleColorAt(1),
gfx::SkColorToSRGBNSColor(app_list::kGridTitleColor));

[apps_grid_controller_ selectItemAtIndex:1];
EXPECT_NSEQ(ButtonTitleColorAt(0),
gfx::SkColorToSRGBNSColor(app_list::kGridTitleColor));
EXPECT_NSEQ(ButtonTitleColorAt(1),
gfx::SkColorToSRGBNSColor(app_list::kGridTitleHoverColor));
}

// Tests basic keyboard navigation on the first page.
TEST_F(AppsGridControllerTest, FirstPageKeyboardNavigation) {
model()->PopulateApps(kItemsPerPage - 2);
Expand Down
11 changes: 5 additions & 6 deletions ui/app_list/cocoa/apps_grid_view_item.mm
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,11 @@ - (void)updateButtonTitle {
NSDictionary* titleAttributes = @{
NSParagraphStyleAttributeName : paragraphStyle,
NSFontAttributeName : ui::ResourceBundle::GetSharedInstance()
.GetFontList(app_list::kItemTextFontStyle)
.DeriveWithSizeDelta(kMacFontSizeDelta)
.GetPrimaryFont()
.GetNativeFont(),
NSForegroundColorAttributeName : [self isSelected] ?
gfx::SkColorToSRGBNSColor(app_list::kGridTitleHoverColor) :
.GetFontList(app_list::kItemTextFontStyle)
.DeriveWithSizeDelta(kMacFontSizeDelta)
.GetPrimaryFont()
.GetNativeFont(),
NSForegroundColorAttributeName :
gfx::SkColorToSRGBNSColor(app_list::kGridTitleColor)
};
NSString* buttonTitle =
Expand Down
2 changes: 0 additions & 2 deletions ui/app_list/views/app_list_item_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,10 @@ void AppListItemView::StateChanged() {
// keyboard selection; for mouse hover, keyboard selection takes precedence.
if (!apps_grid_view_->IsSelectedView(this) || state() == STATE_PRESSED)
SetItemIsHighlighted(true);
title_->SetEnabledColor(kGridTitleHoverColor);
} else {
SetItemIsHighlighted(false);
if (item_weak_)
item_weak_->set_highlighted(false);
title_->SetEnabledColor(kGridTitleColor);
}
SetTitleSubpixelAA();
}
Expand Down

0 comments on commit 9ae98d7

Please sign in to comment.