Commit 3b74c2c9 authored by mukai's avatar mukai Committed by Commit bot

Specifies transparent background for the label in TileItemView.

We may not use single background when it's in Athena (it's not
used yet though).

BUG=425717
R=xiyuan@chromium.org
TEST=manually

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

Cr-Commit-Position: refs/heads/master@{#301007}
parent a867ca2b
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "ui/app_list/app_list_view_delegate.h" #include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/search_result.h" #include "ui/app_list/search_result.h"
#include "ui/app_list/views/app_list_main_view.h" #include "ui/app_list/views/app_list_main_view.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/color_analysis.h" #include "ui/gfx/color_analysis.h"
#include "ui/gfx/color_utils.h" #include "ui/gfx/color_utils.h"
...@@ -24,6 +25,14 @@ namespace { ...@@ -24,6 +25,14 @@ namespace {
const int kTileSize = 90; const int kTileSize = 90;
const int kTileHorizontalPadding = 10; const int kTileHorizontalPadding = 10;
// In Windows, transparent background color will cause ugly text rendering,
// therefore kContentsBackgroundColor should be used. See crbug.com/406989
#if defined(OS_CHROMEOS)
const SkColor kTitleBackgroundColor = SK_ColorTRANSPARENT;
#else
const SkColor kTitleBackgroundColor = app_list::kContentsBackgroundColor;
#endif
} // namespace } // namespace
namespace app_list { namespace app_list {
...@@ -45,7 +54,7 @@ TileItemView::TileItemView() ...@@ -45,7 +54,7 @@ TileItemView::TileItemView()
title_->SetAutoColorReadabilityEnabled(false); title_->SetAutoColorReadabilityEnabled(false);
title_->SetEnabledColor(kGridTitleColor); title_->SetEnabledColor(kGridTitleColor);
title_->set_background(views::Background::CreateSolidBackground( title_->set_background(views::Background::CreateSolidBackground(
app_list::kContentsBackgroundColor)); kTitleBackgroundColor));
title_->SetFontList(rb.GetFontList(kItemTextFontStyle)); title_->SetFontList(rb.GetFontList(kItemTextFontStyle));
title_->SetHorizontalAlignment(gfx::ALIGN_CENTER); title_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
......
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