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

Unified Diff: ash/common/system/tray/tray_background_view.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: split shelf and tray constants 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
« no previous file with comments | « ash/common/shelf/shelf_constants.cc ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_background_view.cc
diff --git a/ash/common/system/tray/tray_background_view.cc b/ash/common/system/tray/tray_background_view.cc
index 1fdbfd75359204d044d06356ab10a36989ce2206..2192034abaa42599a181c45050136a256754490b 100644
--- a/ash/common/system/tray/tray_background_view.cc
+++ b/ash/common/system/tray/tray_background_view.cc
@@ -106,19 +106,17 @@ class TrayBackground : public views::Background {
// 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(view->GetLocalBounds(), kCornerRadius,
+ canvas->DrawRoundRect(view->GetLocalBounds(), kTrayRoundedBorderRadius,
background_paint);
if (tray_background_view_->draw_background_as_active()) {
SkPaint highlight_paint;
highlight_paint.setFlags(SkPaint::kAntiAlias_Flag);
highlight_paint.setColor(kShelfButtonActivatedHighlightColor);
- canvas->DrawRoundRect(view->GetLocalBounds(), kCornerRadius,
+ canvas->DrawRoundRect(view->GetLocalBounds(), kTrayRoundedBorderRadius,
highlight_paint);
}
}
@@ -203,17 +201,20 @@ void TrayBackgroundView::TrayContainer::ViewHierarchyChanged(
PreferredSizeChanged();
}
-// TODO(tdanderson): Adjust TrayContainer borders according to the material
-// design specs. See crbug.com/617295.
void TrayBackgroundView::TrayContainer::UpdateLayout() {
// Adjust the size of status tray dark background by adding additional
// empty border.
views::BoxLayout::Orientation orientation =
IsHorizontalAlignment(alignment_) ? views::BoxLayout::kHorizontal
: views::BoxLayout::kVertical;
- SetBorder(views::Border::CreateEmptyBorder(
- kAdjustBackgroundPadding, kAdjustBackgroundPadding,
- kAdjustBackgroundPadding, kAdjustBackgroundPadding));
+
+ if (!ash::MaterialDesignController::IsShelfMaterial()) {
+ // Additional padding used to adjust the user-visible size of status tray
+ // dark background.
+ const int padding = 3;
+ SetBorder(
+ views::Border::CreateEmptyBorder(padding, padding, padding, padding));
+ }
views::BoxLayout* layout = new views::BoxLayout(orientation, 0, 0, 0);
layout->SetDefaultFlex(1);
« no previous file with comments | « ash/common/shelf/shelf_constants.cc ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698