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

Unified Diff: ash/common/system/date/date_view.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/chromeos/power/tray_power.cc ('k') | ash/common/system/date/tray_date.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/date/date_view.cc
diff --git a/ash/common/system/date/date_view.cc b/ash/common/system/date/date_view.cc
index ad21c9146a45d487293692233650239102e62449..40d54eb1076fc4254eaf4dff18ce7d80f41e43b4 100644
--- a/ash/common/system/date/date_view.cc
+++ b/ash/common/system/date/date_view.cc
@@ -19,9 +19,11 @@
#include "third_party/icu/source/i18n/unicode/smpdtfmt.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
+#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/grid_layout.h"
#include "ui/views/widget/widget.h"
@@ -290,8 +292,7 @@ void TimeView::UpdateClockLayout(TrayDate::ClockLayout clock_layout) {
if (clock_layout == TrayDate::HORIZONTAL_CLOCK) {
RemoveChildView(vertical_label_hours_.get());
RemoveChildView(vertical_label_minutes_.get());
- SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
+ SetLayoutManager(new views::FillLayout());
AddChildView(horizontal_label_.get());
} else {
const bool is_material_design = MaterialDesignController::IsShelfMaterial();
@@ -320,16 +321,13 @@ void TimeView::UpdateClockLayout(TrayDate::ClockLayout clock_layout) {
}
void TimeView::SetBorderFromLayout(TrayDate::ClockLayout clock_layout) {
+ if (MaterialDesignController::IsShelfMaterial())
+ return;
+
if (clock_layout == TrayDate::HORIZONTAL_CLOCK) {
- bool is_material_design = MaterialDesignController::IsShelfMaterial();
- const int time_view_left_padding =
- is_material_design ? kClockLeadingPadding
- : kTrayLabelItemHorizontalPaddingBottomAlignment;
- const int time_view_right_padding =
- is_material_design ? GetTrayConstant(TRAY_IMAGE_ITEM_PADDING)
- : kTrayLabelItemHorizontalPaddingBottomAlignment;
- SetBorder(views::Border::CreateEmptyBorder(0, time_view_left_padding, 0,
- time_view_right_padding));
+ SetBorder(views::Border::CreateEmptyBorder(
+ 0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0,
+ kTrayLabelItemHorizontalPaddingBottomAlignment));
} else {
SetBorder(views::Border::NullBorder());
}
« no previous file with comments | « ash/common/system/chromeos/power/tray_power.cc ('k') | ash/common/system/date/tray_date.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698