OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
6 #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 icon_placement_ = icon_placement; | 131 icon_placement_ = icon_placement; |
132 } | 132 } |
133 | 133 |
134 // TextButton remembers the maximum display size of the text passed to | 134 // TextButton remembers the maximum display size of the text passed to |
135 // SetText. This method resets the cached maximum display size to the | 135 // SetText. This method resets the cached maximum display size to the |
136 // current size. | 136 // current size. |
137 void ClearMaxTextSize(); | 137 void ClearMaxTextSize(); |
138 | 138 |
139 void set_max_width(int max_width) { max_width_ = max_width; } | 139 void set_max_width(int max_width) { max_width_ = max_width; } |
140 void SetFont(const gfx::Font& font); | 140 void SetFont(const gfx::Font& font); |
| 141 // Return the font used by this button. |
| 142 gfx::Font font() const { return font_; } |
| 143 |
141 void SetEnabledColor(SkColor color); | 144 void SetEnabledColor(SkColor color); |
142 void SetDisabledColor(SkColor color); | 145 void SetDisabledColor(SkColor color); |
143 void SetHighlightColor(SkColor color); | 146 void SetHighlightColor(SkColor color); |
144 void SetHoverColor(SkColor color); | 147 void SetHoverColor(SkColor color); |
145 void SetTextHaloColor(SkColor color); | 148 void SetTextHaloColor(SkColor color); |
146 void SetNormalHasBorder(bool normal_has_border); | 149 void SetNormalHasBorder(bool normal_has_border); |
147 // Sets whether or not to show the hot and pushed states for the button icon | 150 // Sets whether or not to show the hot and pushed states for the button icon |
148 // (if present) in addition to the normal state. Defaults to true. | 151 // (if present) in addition to the normal state. Defaults to true. |
149 void SetShowMultipleIconStates(bool show_multiple_icon_states); | 152 void SetShowMultipleIconStates(bool show_multiple_icon_states); |
150 | 153 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 240 |
238 // Space between icon and text. | 241 // Space between icon and text. |
239 int icon_text_spacing_; | 242 int icon_text_spacing_; |
240 | 243 |
241 DISALLOW_COPY_AND_ASSIGN(TextButton); | 244 DISALLOW_COPY_AND_ASSIGN(TextButton); |
242 }; | 245 }; |
243 | 246 |
244 } // namespace views | 247 } // namespace views |
245 | 248 |
246 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 249 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
OLD | NEW |