OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/system/tray/tray_item_more.h" |
| 6 |
| 7 #include "ash/system/tray/tray_constants.h" |
| 8 #include "grit/ui_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/image/image.h" |
| 11 #include "ui/views/controls/image_view.h" |
| 12 |
| 13 namespace ash { |
| 14 namespace internal { |
| 15 |
| 16 TrayItemMore::TrayItemMore() |
| 17 : more_(NULL) { |
| 18 } |
| 19 |
| 20 TrayItemMore::~TrayItemMore() { |
| 21 } |
| 22 |
| 23 void TrayItemMore::AddMore() { |
| 24 more_ = new views::ImageView; |
| 25 more_->SetImage(ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 26 IDR_AURA_UBER_TRAY_MORE).ToSkBitmap()); |
| 27 AddChildView(more_); |
| 28 } |
| 29 |
| 30 void TrayItemMore::Layout() { |
| 31 // Let the box-layout do the layout first. Then move the '>' arrow to right |
| 32 // align. |
| 33 views::View::Layout(); |
| 34 |
| 35 gfx::Rect bounds = more_->bounds(); |
| 36 bounds.set_x(width() - more_->width() - kTrayPopupPaddingBetweenItems); |
| 37 more_->SetBoundsRect(bounds); |
| 38 } |
| 39 |
| 40 } // namespace internal |
| 41 } // namespace ash |
OLD | NEW |