OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/views/examples/vector_example.h" | 5 #include "ui/views/examples/vector_example.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 public TextfieldController, | 31 public TextfieldController, |
32 public ButtonListener { | 32 public ButtonListener { |
33 public: | 33 public: |
34 VectorIconGallery() | 34 VectorIconGallery() |
35 : image_view_(new ImageView()), | 35 : image_view_(new ImageView()), |
36 image_view_container_(new views::View()), | 36 image_view_container_(new views::View()), |
37 size_input_(new Textfield()), | 37 size_input_(new Textfield()), |
38 color_input_(new Textfield()), | 38 color_input_(new Textfield()), |
39 file_chooser_(new Textfield()), | 39 file_chooser_(new Textfield()), |
40 file_go_button_( | 40 file_go_button_( |
41 MdTextButton::CreateStandardButton(this, | 41 MdTextButton::Create(this, base::ASCIIToUTF16("Render"))), |
42 base::ASCIIToUTF16("Render"))), | |
43 vector_id_(0), | 42 vector_id_(0), |
44 // 36dp is one of the natural sizes for MD icons, and corresponds | 43 // 36dp is one of the natural sizes for MD icons, and corresponds |
45 // roughly to a 32dp usable area. | 44 // roughly to a 32dp usable area. |
46 size_(36), | 45 size_(36), |
47 color_(SK_ColorRED) { | 46 color_(SK_ColorRED) { |
48 AddChildView(size_input_); | 47 AddChildView(size_input_); |
49 AddChildView(color_input_); | 48 AddChildView(color_input_); |
50 | 49 |
51 image_view_container_->AddChildView(image_view_); | 50 image_view_container_->AddChildView(image_view_); |
52 BoxLayout* image_layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0); | 51 BoxLayout* image_layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 164 |
166 VectorExample::~VectorExample() {} | 165 VectorExample::~VectorExample() {} |
167 | 166 |
168 void VectorExample::CreateExampleView(View* container) { | 167 void VectorExample::CreateExampleView(View* container) { |
169 container->SetLayoutManager(new FillLayout()); | 168 container->SetLayoutManager(new FillLayout()); |
170 container->AddChildView(new VectorIconGallery()); | 169 container->AddChildView(new VectorIconGallery()); |
171 } | 170 } |
172 | 171 |
173 } // namespace examples | 172 } // namespace examples |
174 } // namespace views | 173 } // namespace views |
OLD | NEW |