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 SetNormalHasBorder(bool normal_has_border); | 148 void SetNormalHasBorder(bool normal_has_border); |
146 // Sets whether or not to show the hot and pushed states for the button icon | 149 // Sets whether or not to show the hot and pushed states for the button icon |
147 // (if present) in addition to the normal state. Defaults to true. | 150 // (if present) in addition to the normal state. Defaults to true. |
148 void SetShowMultipleIconStates(bool show_multiple_icon_states); | 151 void SetShowMultipleIconStates(bool show_multiple_icon_states); |
149 | 152 |
150 // Paint the button into the specified canvas. If |for_drag| is true, the | 153 // Paint the button into the specified canvas. If |for_drag| is true, the |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 235 |
233 // Space between icon and text. | 236 // Space between icon and text. |
234 int icon_text_spacing_; | 237 int icon_text_spacing_; |
235 | 238 |
236 DISALLOW_COPY_AND_ASSIGN(TextButton); | 239 DISALLOW_COPY_AND_ASSIGN(TextButton); |
237 }; | 240 }; |
238 | 241 |
239 } // namespace views | 242 } // namespace views |
240 | 243 |
241 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 244 #endif // VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
OLD | NEW |