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

Unified Diff: ui/views/examples/button_example.cc

Issue 12330002: Add views::Button style enum for LabelButton [native] styling, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add views::Button style enum for LabelButton [native] styling, etc. Created 7 years, 10 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
Index: ui/views/examples/button_example.cc
diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc
index 93e7acb49f3454cd689a0f57ab4b7af6ca97db19..fb44500af1328ae388b4590f2c00424e627cfe84 100644
--- a/ui/views/examples/button_example.cc
+++ b/ui/views/examples/button_example.cc
@@ -42,7 +42,7 @@ void ButtonExample::CreateExampleView(View* container) {
label_button_ = new LabelButton(this, ASCIIToUTF16("Label Button"));
label_button_->set_focusable(true);
- label_button_->SetTextColor(CustomButton::STATE_HOVERED, SK_ColorRED);
+ label_button_->SetTextColor(Button::STATE_HOVERED, SK_ColorRED);
container->AddChildView(label_button_);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
@@ -145,8 +145,8 @@ void ButtonExample::LabelButtonPressed(const ui::Event& event) {
string16() : ASCIIToUTF16("Label Button"));
}
} else if (event.IsAltDown()) {
- label_button_->SetImage(CustomButton::STATE_NORMAL,
- label_button_->GetImage(CustomButton::STATE_NORMAL).isNull() ?
+ label_button_->SetImage(Button::STATE_NORMAL,
+ label_button_->GetImage(Button::STATE_NORMAL).isNull() ?
*icon_ : gfx::ImageSkia());
} else {
label_button_->SetHorizontalAlignment(
@@ -161,7 +161,8 @@ void ButtonExample::LabelButtonPressed(const ui::Event& event) {
"ReallyReallyReallyReallyReallyReallyReally"
"ReallyReallyReallyReallyReallyReallyReallyLongButtonText"));
} else {
- label_button_->SetNativeTheme(!label_button_->native_theme());
+ label_button_->SetStyle(static_cast<Button::ButtonStyle>(
+ (label_button_->style() + 1) % Button::STYLE_COUNT));
}
} else if (event.IsAltDown()) {
label_button_->SetDefaultButton(!label_button_->default_button());
« ui/views/controls/button/button.h ('K') | « ui/views/controls/button/label_button_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698