OLD | NEW |
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/controls/button/label_button.h" | 5 #include "ui/views/controls/button/label_button.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.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/animation/throb_animation.h" | 10 #include "ui/gfx/animation/throb_animation.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 cached_normal_font_list_ = font_list; | 116 cached_normal_font_list_ = font_list; |
117 cached_bold_font_list_ = font_list.DeriveWithStyle( | 117 cached_bold_font_list_ = font_list.DeriveWithStyle( |
118 font_list.GetFontStyle() | gfx::Font::BOLD); | 118 font_list.GetFontStyle() | gfx::Font::BOLD); |
119 | 119 |
120 // STYLE_BUTTON uses bold text to indicate default buttons. | 120 // STYLE_BUTTON uses bold text to indicate default buttons. |
121 label_->SetFontList( | 121 label_->SetFontList( |
122 style_ == STYLE_BUTTON && is_default_ ? | 122 style_ == STYLE_BUTTON && is_default_ ? |
123 cached_bold_font_list_ : cached_normal_font_list_); | 123 cached_bold_font_list_ : cached_normal_font_list_); |
124 } | 124 } |
125 | 125 |
126 void LabelButton::SetElideBehavior(Label::ElideBehavior elide_behavior) { | 126 void LabelButton::SetElideBehavior(gfx::ElideBehavior elide_behavior) { |
127 label_->SetElideBehavior(elide_behavior); | 127 label_->SetElideBehavior(elide_behavior); |
128 } | 128 } |
129 | 129 |
130 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { | 130 gfx::HorizontalAlignment LabelButton::GetHorizontalAlignment() const { |
131 return label_->horizontal_alignment(); | 131 return label_->horizontal_alignment(); |
132 } | 132 } |
133 | 133 |
134 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { | 134 void LabelButton::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) { |
135 label_->SetHorizontalAlignment(alignment); | 135 label_->SetHorizontalAlignment(alignment); |
136 InvalidateLayout(); | 136 InvalidateLayout(); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return ui::NativeTheme::kNormal; | 429 return ui::NativeTheme::kNormal; |
430 } | 430 } |
431 | 431 |
432 ui::NativeTheme::State LabelButton::GetForegroundThemeState( | 432 ui::NativeTheme::State LabelButton::GetForegroundThemeState( |
433 ui::NativeTheme::ExtraParams* params) const { | 433 ui::NativeTheme::ExtraParams* params) const { |
434 GetExtraParams(params); | 434 GetExtraParams(params); |
435 return ui::NativeTheme::kHovered; | 435 return ui::NativeTheme::kHovered; |
436 } | 436 } |
437 | 437 |
438 } // namespace views | 438 } // namespace views |
OLD | NEW |