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

Unified Diff: ash/system/power/tray_power.cc

Issue 10411081: Fixup layout of power and sms notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/system/network/tray_sms.cc ('k') | ash/system/tray/tray_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/tray_power.cc
diff --git a/ash/system/power/tray_power.cc b/ash/system/power/tray_power.cc
index 72e4142ad3cb86dd6d07726d8ed968fcdfef9c4a..f2ff5fb7fd18eb903b2dbfb99d9177e22656d765 100644
--- a/ash/system/power/tray_power.cc
+++ b/ash/system/power/tray_power.cc
@@ -131,9 +131,9 @@ class PowerStatusView : public views::View {
explicit PowerStatusView(ViewType view_type) {
status_label_ = new views::Label;
- status_label_->SetHorizontalAlignment(views::Label::ALIGN_RIGHT);
+ status_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
time_label_ = new views::Label;
- time_label_->SetHorizontalAlignment(views::Label::ALIGN_RIGHT);
+ time_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
icon_ = new views::ImageView;
@@ -199,6 +199,9 @@ class PowerStatusView : public views::View {
}
void LayoutNotificationView() {
+ const int msg_width = kTrayPopupWidth - kNotificationCloseButtonWidth -
+ kTrayPopupPaddingHorizontal - kNotificationIconWidth;
+
views::GridLayout* layout = new views::GridLayout(this);
SetLayoutManager(layout);
@@ -206,20 +209,23 @@ class PowerStatusView : public views::View {
// Icon
columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
- 0, views::GridLayout::USE_PREF, 0, 0);
+ 0 /* resize percent */,
+ views::GridLayout::FIXED,
+ kNotificationIconWidth, kNotificationIconWidth);
columns->AddPaddingColumn(0, kTrayPopupPaddingHorizontal/2);
// Status + Time
columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
- 0, views::GridLayout::USE_PREF, 0, kLabelMinWidth);
+ 0 /* resize percent */,
+ views::GridLayout::FIXED, msg_width, msg_width);
- layout->AddPaddingRow(0, kPaddingVertical);
+ // Layout rows
+ layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems);
layout->StartRow(0, 0);
- layout->AddView(icon_, 1, 3); // 3 rows for icon
+ layout->AddView(icon_, 1, 2); // 2 rows for icon
layout->AddView(status_label_);
- layout->AddPaddingRow(0, kPaddingVertical/3);
layout->StartRow(0, 0);
layout->SkipColumns(1);
« no previous file with comments | « ash/system/network/tray_sms.cc ('k') | ash/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698