OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/common/system/date/date_view.h" | 5 #include "ash/common/system/date/date_view.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/system/tray/system_tray_controller.h" | 8 #include "ash/common/system/tray/system_tray_controller.h" |
9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
10 #include "ash/common/system/tray/tray_popup_item_style.h" | 10 #include "ash/common/system/tray/tray_popup_item_style.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 : BaseDateTimeView(owner), action_(DateAction::NONE) { | 166 : BaseDateTimeView(owner), action_(DateAction::NONE) { |
167 if (UseMd()) { | 167 if (UseMd()) { |
168 // TODO(tdanderson): Tweak spacing and layout for material design. | 168 // TODO(tdanderson): Tweak spacing and layout for material design. |
169 views::BoxLayout* box_layout = | 169 views::BoxLayout* box_layout = |
170 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); | 170 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); |
171 box_layout->set_inside_border_insets(gfx::Insets(0, 12, 0, 0)); | 171 box_layout->set_inside_border_insets(gfx::Insets(0, 12, 0, 0)); |
172 box_layout->set_main_axis_alignment( | 172 box_layout->set_main_axis_alignment( |
173 views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); | 173 views::BoxLayout::MAIN_AXIS_ALIGNMENT_START); |
174 box_layout->set_cross_axis_alignment( | 174 box_layout->set_cross_axis_alignment( |
175 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); | 175 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); |
176 box_layout->set_minimum_cross_axis_size( | |
177 GetTrayConstant(TRAY_POPUP_ITEM_MIN_HEIGHT)); | |
178 SetLayoutManager(box_layout); | 176 SetLayoutManager(box_layout); |
179 } else { | 177 } else { |
180 SetLayoutManager( | 178 SetLayoutManager( |
181 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); | 179 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)); |
182 } | 180 } |
183 date_label_ = TrayPopupUtils::CreateDefaultLabel(); | 181 date_label_ = TrayPopupUtils::CreateDefaultLabel(); |
184 date_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 182 date_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
185 if (!UseMd()) | 183 if (!UseMd()) |
186 date_label_->SetEnabledColor(kHeaderTextColorNormal); | 184 date_label_->SetEnabledColor(kHeaderTextColorNormal); |
187 UpdateTextInternal(base::Time::Now()); | 185 UpdateTextInternal(base::Time::Now()); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } | 406 } |
409 | 407 |
410 void TimeView::SetupLabel(views::Label* label) { | 408 void TimeView::SetupLabel(views::Label* label) { |
411 label->set_owned_by_client(); | 409 label->set_owned_by_client(); |
412 SetupLabelForTray(label); | 410 SetupLabelForTray(label); |
413 label->SetElideBehavior(gfx::NO_ELIDE); | 411 label->SetElideBehavior(gfx::NO_ELIDE); |
414 } | 412 } |
415 | 413 |
416 } // namespace tray | 414 } // namespace tray |
417 } // namespace ash | 415 } // namespace ash |
OLD | NEW |