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

Side by Side Diff: ui/views/examples/button_example.cc

Issue 10933049: Fixed position of plus image on action box button; added ICON_CENTERED placement to TextButton (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « ui/views/controls/button/text_button.cc ('k') | 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 (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 "ui/views/examples/button_example.h" 5 #include "ui/views/examples/button_example.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/image/image.h" 10 #include "ui/gfx/image/image.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 text_button_->SetText(ASCIIToUTF16("Button")); 70 text_button_->SetText(ASCIIToUTF16("Button"));
71 } 71 }
72 } else { 72 } else {
73 switch (text_button_->icon_placement()) { 73 switch (text_button_->icon_placement()) {
74 case TextButton::ICON_ON_LEFT: 74 case TextButton::ICON_ON_LEFT:
75 text_button_->set_icon_placement(TextButton::ICON_ON_RIGHT); 75 text_button_->set_icon_placement(TextButton::ICON_ON_RIGHT);
76 break; 76 break;
77 case TextButton::ICON_ON_RIGHT: 77 case TextButton::ICON_ON_RIGHT:
78 text_button_->set_icon_placement(TextButton::ICON_ON_LEFT); 78 text_button_->set_icon_placement(TextButton::ICON_ON_LEFT);
79 break; 79 break;
80 case TextButton::ICON_CENTERED:
81 // Do nothing.
82 break;
80 } 83 }
81 } 84 }
82 } else if (event.IsAltDown()) { 85 } else if (event.IsAltDown()) {
83 if (text_button_->HasIcon()) 86 if (text_button_->HasIcon())
84 text_button_->SetIcon(gfx::ImageSkia()); 87 text_button_->SetIcon(gfx::ImageSkia());
85 else 88 else
86 text_button_->SetIcon(*icon_); 89 text_button_->SetIcon(*icon_);
87 } else { 90 } else {
88 switch (alignment_) { 91 switch (alignment_) {
89 case TextButton::ALIGN_LEFT: 92 case TextButton::ALIGN_LEFT:
(...skipping 28 matching lines...) Expand all
118 text_button_->set_border(new TextButtonBorder()); 121 text_button_->set_border(new TextButtonBorder());
119 } 122 }
120 } else if (event.IsAltDown()) { 123 } else if (event.IsAltDown()) {
121 text_button_->SetIsDefault(!text_button_->is_default()); 124 text_button_->SetIsDefault(!text_button_->is_default());
122 } 125 }
123 example_view()->GetLayoutManager()->Layout(example_view()); 126 example_view()->GetLayoutManager()->Layout(example_view());
124 } 127 }
125 128
126 } // namespace examples 129 } // namespace examples
127 } // namespace views 130 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/text_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698