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

Unified Diff: ash/common/shelf/app_list_button.cc

Issue 2191153002: Revert of Replaced BackgroundAnimator with ShelfBackgroundAnimator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « ash/common/shelf/app_list_button.h ('k') | ash/common/shelf/overflow_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/app_list_button.cc
diff --git a/ash/common/shelf/app_list_button.cc b/ash/common/shelf/app_list_button.cc
index e31acdf85f0f02fcbe47d827aef833cfd177de0e..7781625be42f4dcf1ec8efdc890ac578b2477da5 100644
--- a/ash/common/shelf/app_list_button.cc
+++ b/ash/common/shelf/app_list_button.cc
@@ -35,7 +35,6 @@
WmShelf* wm_shelf)
: views::ImageButton(nullptr),
draw_background_as_active_(false),
- background_alpha_(0),
listener_(listener),
shelf_view_(shelf_view),
wm_shelf_(wm_shelf) {
@@ -72,11 +71,6 @@
AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr);
else
SchedulePaint();
-}
-
-void AppListButton::SetBackgroundAlpha(int alpha) {
- background_alpha_ = alpha;
- SchedulePaint();
}
bool AppListButton::OnMousePressed(const ui::MouseEvent& event) {
@@ -163,15 +157,21 @@
}
void AppListButton::PaintBackgroundMD(gfx::Canvas* canvas) {
+ SkPaint background_paint;
+ background_paint.setColor(SK_ColorTRANSPARENT);
+ background_paint.setFlags(SkPaint::kAntiAlias_Flag);
+ background_paint.setStyle(SkPaint::kFill_Style);
+
+ if (wm_shelf_->GetBackgroundType() ==
+ ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT) {
+ background_paint.setColor(
+ SkColorSetA(kShelfBaseColor, GetShelfConstant(SHELF_BACKGROUND_ALPHA)));
+ }
+
// Paint the circular background of AppList button.
gfx::Point circle_center = GetContentsBounds().CenterPoint();
if (!IsHorizontalAlignment(wm_shelf_->GetAlignment()))
circle_center = gfx::Point(circle_center.y(), circle_center.x());
-
- SkPaint background_paint;
- background_paint.setColor(SkColorSetA(kShelfBaseColor, background_alpha_));
- background_paint.setFlags(SkPaint::kAntiAlias_Flag);
- background_paint.setStyle(SkPaint::kFill_Style);
canvas->DrawCircle(circle_center, kAppListButtonRadius, background_paint);
}
« no previous file with comments | « ash/common/shelf/app_list_button.h ('k') | ash/common/shelf/overflow_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698