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

Unified Diff: ash/shelf/overflow_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/overflow_button.cc
diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
index 45130f723213c5343beea48cfee63971836ffb84..2480e6137eafeda75da461cd3acc4d325eb09744 100644
--- a/ash/shelf/overflow_button.cc
+++ b/ash/shelf/overflow_button.cc
@@ -81,18 +81,16 @@ void OverflowButton::PaintBackground(gfx::Canvas* canvas,
// TODO(bruthig|tdanderson): The background should be changed using a
// fade in/out animation.
- const int kCornerRadius = 2;
-
SkPaint background_paint;
background_paint.setFlags(SkPaint::kAntiAlias_Flag);
background_paint.setColor(background_color);
- canvas->DrawRoundRect(bounds, kCornerRadius, background_paint);
+ canvas->DrawRoundRect(bounds, kTrayRoundedBorderRadius, background_paint);
if (shelf_->IsShowingOverflowBubble()) {
SkPaint highlight_paint;
highlight_paint.setFlags(SkPaint::kAntiAlias_Flag);
highlight_paint.setColor(kShelfButtonActivatedHighlightColor);
- canvas->DrawRoundRect(bounds, kCornerRadius, highlight_paint);
+ canvas->DrawRoundRect(bounds, kTrayRoundedBorderRadius, highlight_paint);
}
} else {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -145,14 +143,13 @@ gfx::Rect OverflowButton::CalculateButtonBounds() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
if (MaterialDesignController::IsShelfMaterial()) {
if (shelf_->IsHorizontalAlignment()) {
- bounds = gfx::Rect((bounds.x() + (bounds.width() - kShelfItemSizeMD) / 2),
- bounds.y() + (bounds.height() - kShelfItemSizeMD) / 2,
- kShelfItemSizeMD, kShelfItemSizeMD);
+ bounds = gfx::Rect((bounds.x() + (bounds.width() - kTrayItemSize) / 2),
James Cook 2016/06/27 18:04:12 It's odd that you're using a constant named "tray"
tdanderson 2016/06/27 21:29:42 This has been in the back of my mind for a while n
James Cook 2016/06/27 22:53:21 Yeah, I can't think of a good shared name either.
tdanderson 2016/06/28 16:32:44 As discussed, in this CL I will un-blur the lines
+ bounds.y() + (bounds.height() - kTrayItemSize) / 2,
+ kTrayItemSize, kTrayItemSize);
} else {
- bounds =
- gfx::Rect(bounds.x() + ((bounds.height() - kShelfItemSizeMD) / 2),
- bounds.y() + (bounds.width() - kShelfItemSizeMD) / 2,
- kShelfItemSizeMD, kShelfItemSizeMD);
+ bounds = gfx::Rect(bounds.x() + ((bounds.height() - kTrayItemSize) / 2),
yiyix 2016/06/27 18:39:43 May create a constant for (bounds.height() - kTray
tdanderson 2016/06/27 21:29:42 Done.
+ bounds.y() + (bounds.width() - kTrayItemSize) / 2,
+ kTrayItemSize, kTrayItemSize);
}
} else {
const gfx::ImageSkia* background =

Powered by Google App Engine
This is Rietveld 408576698