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

Unified Diff: ash/common/system/tray/tray_image_item.cc

Issue 2455183002: Simplify layout of tray items and fix spacing for MD. (Closed)
Patch Set: tda review Created 4 years, 2 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/system/tray/tray_image_item.h ('k') | ash/common/system/tray/tray_item_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_image_item.cc
diff --git a/ash/common/system/tray/tray_image_item.cc b/ash/common/system/tray/tray_image_item.cc
index 776b38f1ce7688881741cc4f6e14bfad92f71a6f..f306e48d6f0f91d9c7f4a81f4a317308472c6887 100644
--- a/ash/common/system/tray/tray_image_item.cc
+++ b/ash/common/system/tray/tray_image_item.cc
@@ -73,7 +73,6 @@ views::View* TrayImageItem::CreateTrayView(LoginStatus status) {
tray_view_->CreateImageView();
UpdateImageOnImageView();
tray_view_->SetVisible(GetInitialVisibility());
- SetItemAlignment(system_tray()->shelf_alignment());
return tray_view_;
}
@@ -89,7 +88,6 @@ void TrayImageItem::UpdateAfterLoginStatusChange(LoginStatus status) {}
void TrayImageItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
SetTrayImageItemBorder(tray_view_, alignment);
- SetItemAlignment(alignment);
}
void TrayImageItem::DestroyTrayView() {
@@ -110,15 +108,6 @@ void TrayImageItem::SetImageFromResourceId(int resource_id) {
UpdateImageOnImageView();
}
-void TrayImageItem::SetItemAlignment(ShelfAlignment alignment) {
- // Center the item dependent on the orientation of the shelf.
- views::BoxLayout::Orientation layout = IsHorizontalAlignment(alignment)
- ? views::BoxLayout::kHorizontal
- : views::BoxLayout::kVertical;
- tray_view_->SetLayoutManager(new views::BoxLayout(layout, 0, 0, 0));
- tray_view_->Layout();
-}
-
void TrayImageItem::UpdateImageOnImageView() {
if (!tray_view_)
return;
« no previous file with comments | « ash/common/system/tray/tray_image_item.h ('k') | ash/common/system/tray/tray_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698