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

Unified Diff: ash/system/user/tray_user.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/system/status_area_widget_delegate.cc ('k') | ash/system/user/user_card_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/user/tray_user.cc
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index 2f633aabe9a356b53f5b02f78c6ceae528930611..e0699c1a39ec6feefbb838c983226a11358595bd 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -159,7 +159,7 @@ void TrayUser::UpdateAfterLoginStatusChange(LoginStatus status) {
label_ = nullptr;
}
if (need_avatar) {
- avatar_ = new tray::RoundedImageView(kTrayAvatarCornerRadius, true);
+ avatar_ = new tray::RoundedImageView(kTrayRoundedBorderRadius, true);
layout_view_->AddChildView(avatar_);
} else {
avatar_ = nullptr;
@@ -174,8 +174,8 @@ void TrayUser::UpdateAfterLoginStatusChange(LoginStatus status) {
}
if (avatar_) {
- avatar_->SetCornerRadii(0, kTrayAvatarCornerRadius, kTrayAvatarCornerRadius,
- 0);
+ avatar_->SetCornerRadii(0, kTrayRoundedBorderRadius,
+ kTrayRoundedBorderRadius, 0);
avatar_->SetBorder(views::Border::NullBorder());
}
UpdateAvatarImage(status);
@@ -191,8 +191,8 @@ void TrayUser::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
if (IsHorizontalAlignment(alignment)) {
if (avatar_) {
avatar_->SetBorder(views::Border::NullBorder());
- avatar_->SetCornerRadii(0, kTrayAvatarCornerRadius,
- kTrayAvatarCornerRadius, 0);
+ avatar_->SetCornerRadii(0, kTrayRoundedBorderRadius,
+ kTrayRoundedBorderRadius, 0);
}
if (label_) {
// If label_ hasn't figured out its size yet, do that first.
@@ -211,8 +211,8 @@ void TrayUser::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
} else {
if (avatar_) {
avatar_->SetBorder(views::Border::NullBorder());
- avatar_->SetCornerRadii(0, 0, kTrayAvatarCornerRadius,
- kTrayAvatarCornerRadius);
+ avatar_->SetCornerRadii(0, 0, kTrayRoundedBorderRadius,
+ kTrayRoundedBorderRadius);
}
if (label_) {
label_->SetBorder(views::Border::CreateEmptyBorder(
@@ -257,11 +257,11 @@ void TrayUser::UpdateAvatarImage(LoginStatus status) {
session_state_delegate->GetUserInfo(user_index_);
CHECK(user_info);
avatar_->SetImage(user_info->GetImage(),
- gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
+ gfx::Size(kTrayItemSize, kTrayItemSize));
// Unit tests might come here with no images for some users.
if (avatar_->size().IsEmpty())
- avatar_->SetSize(gfx::Size(kTrayAvatarSize, kTrayAvatarSize));
+ avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize));
}
void TrayUser::UpdateLayoutOfItem() {
« no previous file with comments | « ash/system/status_area_widget_delegate.cc ('k') | ash/system/user/user_card_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698