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

Side by Side Diff: ash/system/date/tray_date.cc

Issue 10668009: UI refinement for left/right ash tray and bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/system/date/date_view.cc ('k') | ash/system/status_area_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/system/date/tray_date.h" 5 #include "ash/system/date/tray_date.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/date/date_view.h" 8 #include "ash/system/date/date_view.h"
9 #include "ash/system/tray/system_tray.h" 9 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 TrayDate::TrayDate() 124 TrayDate::TrayDate()
125 : time_tray_(NULL) { 125 : time_tray_(NULL) {
126 } 126 }
127 127
128 TrayDate::~TrayDate() { 128 TrayDate::~TrayDate() {
129 } 129 }
130 130
131 views::View* TrayDate::CreateTrayView(user::LoginStatus status) { 131 views::View* TrayDate::CreateTrayView(user::LoginStatus status) {
132 CHECK(time_tray_ == NULL); 132 CHECK(time_tray_ == NULL);
133 time_tray_ = new tray::TimeView();
134 ClockLayout clock_layout = 133 ClockLayout clock_layout =
135 ash::Shell::GetInstance()->system_tray()->shelf_alignment() == 134 ash::Shell::GetInstance()->system_tray()->shelf_alignment() ==
136 SHELF_ALIGNMENT_BOTTOM ? 135 SHELF_ALIGNMENT_BOTTOM ?
137 HORIZONTAL_CLOCK : VERTICAL_CLOCK; 136 HORIZONTAL_CLOCK : VERTICAL_CLOCK;
138 time_tray_->UpdateClockLayout(clock_layout); 137 time_tray_ = new tray::TimeView(clock_layout);
139 SetupLabelForTimeTray(time_tray_->label());
140 SetupLabelForTimeTray(time_tray_->label_hour());
141 SetupLabelForTimeTray(time_tray_->label_minute());
142
143 views::View* view = new TrayItemView; 138 views::View* view = new TrayItemView;
144 view->AddChildView(time_tray_); 139 view->AddChildView(time_tray_);
145 return view; 140 return view;
146 } 141 }
147 142
148 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) { 143 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) {
149 return new DateDefaultView(status); 144 return new DateDefaultView(status);
150 } 145 }
151 146
152 views::View* TrayDate::CreateDetailedView(user::LoginStatus status) { 147 views::View* TrayDate::CreateDetailedView(user::LoginStatus status) {
(...skipping 24 matching lines...) Expand all
177 void TrayDate::OnDateFormatChanged() { 172 void TrayDate::OnDateFormatChanged() {
178 if (time_tray_) 173 if (time_tray_)
179 time_tray_->UpdateTimeFormat(); 174 time_tray_->UpdateTimeFormat();
180 } 175 }
181 176
182 void TrayDate::Refresh() { 177 void TrayDate::Refresh() {
183 if (time_tray_) 178 if (time_tray_)
184 time_tray_->UpdateText(); 179 time_tray_->UpdateText();
185 } 180 }
186 181
187 void TrayDate::SetupLabelForTimeTray(views::Label* label) {
188 SetupLabelForTray(label);
189 gfx::Font font = label->font();
190 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD));
191 }
192
193 } // namespace internal 182 } // namespace internal
194 } // namespace ash 183 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/date/date_view.cc ('k') | ash/system/status_area_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698