| Index: ui/app_list/views/tile_item_view.cc
|
| diff --git a/ui/app_list/views/tile_item_view.cc b/ui/app_list/views/tile_item_view.cc
|
| index 029df192478145d9ea55550621bee8bd2f548870..c12ed2e4812f623e84e95d458b899c33cd91fbb1 100644
|
| --- a/ui/app_list/views/tile_item_view.cc
|
| +++ b/ui/app_list/views/tile_item_view.cc
|
| @@ -14,7 +14,6 @@
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/color_analysis.h"
|
| #include "ui/gfx/color_utils.h"
|
| -#include "ui/views/background.h"
|
| #include "ui/views/controls/image_view.h"
|
| #include "ui/views/controls/label.h"
|
| #include "ui/views/layout/box_layout.h"
|
| @@ -24,61 +23,15 @@ namespace {
|
| const int kTileSize = 90;
|
| const int kTileHorizontalPadding = 10;
|
|
|
| -const SkColor kTileBackgroundColor = SK_ColorWHITE;
|
| -const int kTileColorStripHeight = 2;
|
| -const SkAlpha kTileColorStripOpacity = 0X5F;
|
| -const int kTileCornerRadius = 2;
|
| -
|
| } // namespace
|
|
|
| namespace app_list {
|
|
|
| -// A background for the start page item view which consists of a rounded rect
|
| -// with a dominant color strip at the bottom.
|
| -class TileItemView::TileItemBackground : public views::Background {
|
| - public:
|
| - TileItemBackground() : strip_color_(SK_ColorBLACK) {}
|
| - virtual ~TileItemBackground() {}
|
| -
|
| - void set_strip_color(SkColor strip_color) { strip_color_ = strip_color; }
|
| -
|
| - // Overridden from views::Background:
|
| - virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
|
| - SkPaint paint;
|
| - paint.setFlags(SkPaint::kAntiAlias_Flag);
|
| -
|
| - // Paint the border.
|
| - paint.setColor(kStartPageBorderColor);
|
| - canvas->DrawRoundRect(view->GetContentsBounds(), kTileCornerRadius, paint);
|
| -
|
| - // Paint a rectangle for the color strip.
|
| - gfx::Rect color_strip_rect(view->GetContentsBounds());
|
| - color_strip_rect.Inset(1, 1, 1, 1);
|
| - paint.setColor(SkColorSetA(strip_color_, kTileColorStripOpacity));
|
| - canvas->DrawRoundRect(color_strip_rect, kTileCornerRadius, paint);
|
| -
|
| - // Paint the main background rectangle, leaving part of the color strip
|
| - // unobscured.
|
| - gfx::Rect static_background_rect(color_strip_rect);
|
| - static_background_rect.Inset(0, 0, 0, kTileColorStripHeight);
|
| - paint.setColor(kTileBackgroundColor);
|
| - canvas->DrawRoundRect(static_background_rect, kTileCornerRadius, paint);
|
| - }
|
| -
|
| - private:
|
| - SkColor strip_color_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(TileItemBackground);
|
| -};
|
| -
|
| TileItemView::TileItemView()
|
| : views::CustomButton(this),
|
| item_(NULL),
|
| icon_(new views::ImageView),
|
| - title_(new views::Label),
|
| - background_(new TileItemBackground()) {
|
| - set_background(background_);
|
| -
|
| + title_(new views::Label) {
|
| views::BoxLayout* layout_manager = new views::BoxLayout(
|
| views::BoxLayout::kVertical, kTileHorizontalPadding, 0, 0);
|
| layout_manager->set_main_axis_alignment(
|
| @@ -141,9 +94,6 @@ void TileItemView::ButtonPressed(views::Button* sender,
|
|
|
| void TileItemView::OnIconChanged() {
|
| icon_->SetImage(item_->icon());
|
| - background_->set_strip_color(
|
| - color_utils::CalculateKMeanColorOfBitmap(*item_->icon().bitmap()));
|
| - SchedulePaint();
|
| }
|
|
|
| void TileItemView::OnResultDestroying() {
|
|
|