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

Unified Diff: ash/shelf/app_list_button.cc

Issue 2099103002: Give Ash material design tray items the correct size and layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for review Created 4 years, 6 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
Index: ash/shelf/app_list_button.cc
diff --git a/ash/shelf/app_list_button.cc b/ash/shelf/app_list_button.cc
index 1fb50398c101db0230bfe64aa0f319a58a00e72f..df42c709ecc5ffcbf918b72640ff37a4e0cb053e 100644
--- a/ash/shelf/app_list_button.cc
+++ b/ash/shelf/app_list_button.cc
@@ -10,6 +10,7 @@
#include "ash/common/shelf/shelf_item_types.h"
#include "ash/common/shelf/shelf_types.h"
#include "ash/common/shelf/wm_shelf_util.h"
+#include "ash/common/system/tray/tray_constants.h"
#include "ash/shelf/ink_drop_button_listener.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_view.h"
@@ -30,9 +31,6 @@
namespace ash {
-// Radius of the app list button circular background.
-const int kAppListButtonBackgroundRadius = 16;
-
AppListButton::AppListButton(InkDropButtonListener* listener,
ShelfView* shelf_view)
: views::ImageButton(nullptr),
@@ -143,12 +141,11 @@ void AppListButton::PaintBackgroundMD(gfx::Canvas* canvas) {
}
// Paint the circular background of AppList button.
+ const int kRadius = kTrayItemSize / 2;
James Cook 2016/06/27 18:04:12 nit: elsewhere you use the style "const int radius
tdanderson 2016/06/27 21:29:42 Done.
gfx::Point circle_center = GetContentsBounds().CenterPoint();
if (!IsHorizontalAlignment(shelf_view_->shelf()->alignment()))
circle_center = gfx::Point(circle_center.y(), circle_center.x());
-
- canvas->DrawCircle(circle_center, kAppListButtonBackgroundRadius,
- background_paint);
+ canvas->DrawCircle(circle_center, kRadius, background_paint);
if (Shell::GetInstance()->GetAppListTargetVisibility() ||
draw_background_as_active_) {
@@ -156,9 +153,7 @@ void AppListButton::PaintBackgroundMD(gfx::Canvas* canvas) {
highlight_paint.setColor(kShelfButtonActivatedHighlightColor);
highlight_paint.setFlags(SkPaint::kAntiAlias_Flag);
highlight_paint.setStyle(SkPaint::kFill_Style);
-
- canvas->DrawCircle(circle_center, kAppListButtonBackgroundRadius,
- highlight_paint);
+ canvas->DrawCircle(circle_center, kRadius, highlight_paint);
}
}

Powered by Google App Engine
This is Rietveld 408576698