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

Side by Side Diff: chrome/browser/ui/views/payments/order_summary_view_controller.cc

Issue 2878813004: [Payments] Order summary amounts are now right-aligned (trailing) (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/ui/views/payments/order_summary_view_controller.h" 5 #include "chrome/browser/ui/views/payments/order_summary_view_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 views::GridLayout* layout = new views::GridLayout(row.get()); 58 views::GridLayout* layout = new views::GridLayout(row.get());
59 row->SetLayoutManager(layout); 59 row->SetLayoutManager(layout);
60 60
61 views::ColumnSet* columns = layout->AddColumnSet(0); 61 views::ColumnSet* columns = layout->AddColumnSet(0);
62 // The first column has resize_percent = 1 so that it streches all the way 62 // The first column has resize_percent = 1 so that it streches all the way
63 // across the row up to the amount label. This way the first label elides as 63 // across the row up to the amount label. This way the first label elides as
64 // required. 64 // required.
65 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 1, 65 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 1,
66 views::GridLayout::USE_PREF, 0, 0); 66 views::GridLayout::USE_PREF, 0, 0);
67 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 0, 67 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0,
68 views::GridLayout::FIXED, kAmountSectionWidth, 68 views::GridLayout::FIXED, kAmountSectionWidth,
69 kAmountSectionWidth); 69 kAmountSectionWidth);
70 70
71 layout->StartRow(0, 0); 71 layout->StartRow(0, 0);
72 std::unique_ptr<views::Label> label_text = 72 std::unique_ptr<views::Label> label_text =
73 base::MakeUnique<views::Label>(label); 73 base::MakeUnique<views::Label>(label);
74 std::unique_ptr<views::Label> amount_text = 74 std::unique_ptr<views::Label> amount_text =
75 base::MakeUnique<views::Label>(amount); 75 base::MakeUnique<views::Label>(amount);
76 amount_text->set_id(static_cast<int>(amount_label_id)); 76 amount_text->set_id(static_cast<int>(amount_label_id));
77 if (emphasize) { 77 if (emphasize) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 total_label_value, true, 162 total_label_value, true,
163 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL) 163 DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL)
164 .release()); 164 .release());
165 } 165 }
166 166
167 void OrderSummaryViewController::UpdatePayButtonState(bool enabled) { 167 void OrderSummaryViewController::UpdatePayButtonState(bool enabled) {
168 pay_button_->SetEnabled(enabled); 168 pay_button_->SetEnabled(enabled);
169 } 169 }
170 170
171 } // namespace payments 171 } // namespace payments
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698