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

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

Issue 10809008: Make spacing between uber tray items consistent with UI spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move SetTrayImageItemBorder etc to tray_views. 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 | « no previous file | ash/system/ime/tray_ime.h » ('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/date_view.h" 5 #include "ash/system/date/date_view.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/system/tray/tray_constants.h" 9 #include "ash/system/tray/tray_constants.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 } else { 215 } else {
216 RemoveChildView(label_.get()); 216 RemoveChildView(label_.get());
217 views::GridLayout* layout = new views::GridLayout(this); 217 views::GridLayout* layout = new views::GridLayout(this);
218 SetLayoutManager(layout); 218 SetLayoutManager(layout);
219 views::ColumnSet* columns = layout->AddColumnSet(0); 219 views::ColumnSet* columns = layout->AddColumnSet(0);
220 columns->AddPaddingColumn(0, 6); 220 columns->AddPaddingColumn(0, 6);
221 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, 221 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER,
222 0, views::GridLayout::USE_PREF, 0, 0); 222 0, views::GridLayout::USE_PREF, 0, 0);
223 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, 223 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER,
224 0, views::GridLayout::USE_PREF, 0, 0); 224 0, views::GridLayout::USE_PREF, 0, 0);
225 layout->AddPaddingRow(0, 4); 225 layout->AddPaddingRow(0, kTrayLabelItemVerticalPaddingVeriticalAlignment);
226 layout->StartRow(0, 0); 226 layout->StartRow(0, 0);
227 layout->AddView(label_hour_left_.get()); 227 layout->AddView(label_hour_left_.get());
228 layout->AddView(label_hour_right_.get()); 228 layout->AddView(label_hour_right_.get());
229 layout->StartRow(0, 0); 229 layout->StartRow(0, 0);
230 layout->AddView(label_minute_left_.get()); 230 layout->AddView(label_minute_left_.get());
231 layout->AddView(label_minute_right_.get()); 231 layout->AddView(label_minute_right_.get());
232 layout->AddPaddingRow(0, 4); 232 layout->AddPaddingRow(0, kTrayLabelItemVerticalPaddingVeriticalAlignment);
233 } 233 }
234 Layout(); 234 Layout();
235 set_focusable(true); 235 set_focusable(true);
236 } 236 }
237 237
238 void TimeView::SetBorder(TrayDate::ClockLayout clock_layout) { 238 void TimeView::SetBorder(TrayDate::ClockLayout clock_layout) {
239 if (clock_layout == TrayDate::HORIZONTAL_CLOCK) 239 if (clock_layout == TrayDate::HORIZONTAL_CLOCK)
240 set_border(views::Border::CreateEmptyBorder(0, 10, 0, 7)); 240 set_border(views::Border::CreateEmptyBorder(
241 0, kTrayLabelItemHorizontalPaddingBottomAlignment,
242 0, kTrayLabelItemHorizontalPaddingBottomAlignment));
241 else 243 else
242 set_border(NULL); 244 set_border(NULL);
243 } 245 }
244 246
245 void TimeView::SetupLabels() { 247 void TimeView::SetupLabels() {
246 label_.reset(CreateLabel()); 248 label_.reset(CreateLabel());
247 SetupLabel(label_.get()); 249 SetupLabel(label_.get());
248 label_hour_left_.reset(CreateLabel()); 250 label_hour_left_.reset(CreateLabel());
249 SetupLabel(label_hour_left_.get()); 251 SetupLabel(label_hour_left_.get());
250 label_hour_right_.reset(CreateLabel()); 252 label_hour_right_.reset(CreateLabel());
251 SetupLabel(label_hour_right_.get()); 253 SetupLabel(label_hour_right_.get());
252 label_minute_left_.reset(CreateLabel()); 254 label_minute_left_.reset(CreateLabel());
253 SetupLabel(label_minute_left_.get()); 255 SetupLabel(label_minute_left_.get());
254 label_minute_right_.reset(CreateLabel()); 256 label_minute_right_.reset(CreateLabel());
255 SetupLabel(label_minute_right_.get()); 257 SetupLabel(label_minute_right_.get());
256 label_hour_left_->SetEnabledColor(kVerticalClockHourColor); 258 label_hour_left_->SetEnabledColor(kVerticalClockHourColor);
257 label_hour_right_->SetEnabledColor(kVerticalClockHourColor); 259 label_hour_right_->SetEnabledColor(kVerticalClockHourColor);
258 } 260 }
259 261
260 void TimeView::SetupLabel(views::Label* label) { 262 void TimeView::SetupLabel(views::Label* label) {
261 label->set_owned_by_client(); 263 label->set_owned_by_client();
262 SetupLabelForTray(label); 264 SetupLabelForTray(label);
263 gfx::Font font = label->font(); 265 gfx::Font font = label->font();
264 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD)); 266 label->SetFont(font.DeriveFont(0, font.GetStyle() & ~gfx::Font::BOLD));
265 } 267 }
266 268
267 } // namespace tray 269 } // namespace tray
268 } // namespace internal 270 } // namespace internal
269 } // namespace ash 271 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/ime/tray_ime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698