| 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 #ifndef UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // TextButton remembers the maximum display size of the text passed to | 138 // TextButton remembers the maximum display size of the text passed to |
| 139 // SetText. This method resets the cached maximum display size to the | 139 // SetText. This method resets the cached maximum display size to the |
| 140 // current size. | 140 // current size. |
| 141 void ClearMaxTextSize(); | 141 void ClearMaxTextSize(); |
| 142 | 142 |
| 143 void set_min_width(int min_width) { min_width_ = min_width; } | 143 void set_min_width(int min_width) { min_width_ = min_width; } |
| 144 void set_min_height(int min_height) { min_height_ = min_height; } | 144 void set_min_height(int min_height) { min_height_ = min_height; } |
| 145 void set_max_width(int max_width) { max_width_ = max_width; } | 145 void set_max_width(int max_width) { max_width_ = max_width; } |
| 146 const gfx::FontList& font_list() const { return font_list_; } | 146 const gfx::FontList& font_list() const { return font_list_; } |
| 147 void SetFontList(const gfx::FontList& font_list); | 147 void SetFontList(const gfx::FontList& font_list); |
| 148 // Obsolete versions. | |
| 149 const gfx::Font& font() const; | |
| 150 void SetFont(const gfx::Font& font); | |
| 151 | 148 |
| 152 void SetEnabledColor(SkColor color); | 149 void SetEnabledColor(SkColor color); |
| 153 void SetDisabledColor(SkColor color); | 150 void SetDisabledColor(SkColor color); |
| 154 void SetHighlightColor(SkColor color); | 151 void SetHighlightColor(SkColor color); |
| 155 void SetHoverColor(SkColor color); | 152 void SetHoverColor(SkColor color); |
| 156 | 153 |
| 157 // Enables a drop shadow underneath the text. | 154 // Enables a drop shadow underneath the text. |
| 158 void SetTextShadowColors(SkColor active_color, SkColor inactive_color); | 155 void SetTextShadowColors(SkColor active_color, SkColor inactive_color); |
| 159 | 156 |
| 160 // Sets the drop shadow's offset from the text. | 157 // Sets the drop shadow's offset from the text. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // The size of the text string. | 243 // The size of the text string. |
| 247 gfx::Size text_size_; | 244 gfx::Size text_size_; |
| 248 | 245 |
| 249 // Track the size of the largest text string seen so far, so that | 246 // Track the size of the largest text string seen so far, so that |
| 250 // changing text_ will not resize the button boundary. | 247 // changing text_ will not resize the button boundary. |
| 251 gfx::Size max_text_size_; | 248 gfx::Size max_text_size_; |
| 252 | 249 |
| 253 // The alignment of the text string within the button. | 250 // The alignment of the text string within the button. |
| 254 TextAlignment alignment_; | 251 TextAlignment alignment_; |
| 255 | 252 |
| 256 // The font used to paint the text. | 253 // The font list used to paint the text. |
| 257 gfx::FontList font_list_; | 254 gfx::FontList font_list_; |
| 258 | 255 |
| 259 // Flag indicating if a shadow should be drawn behind the text. | 256 // Flag indicating if a shadow should be drawn behind the text. |
| 260 bool has_text_shadow_; | 257 bool has_text_shadow_; |
| 261 // Optional shadow text colors for active and inactive widget states. | 258 // Optional shadow text colors for active and inactive widget states. |
| 262 SkColor active_text_shadow_color_; | 259 SkColor active_text_shadow_color_; |
| 263 SkColor inactive_text_shadow_color_; | 260 SkColor inactive_text_shadow_color_; |
| 264 // Space between the text and its shadow. Defaults to (1,1). | 261 // Space between the text and its shadow. Defaults to (1,1). |
| 265 gfx::Point text_shadow_offset_; | 262 gfx::Point text_shadow_offset_; |
| 266 | 263 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // True if the button should ignore the minimum size for the platform. Default | 380 // True if the button should ignore the minimum size for the platform. Default |
| 384 // is true. Set to false to prevent narrower buttons. | 381 // is true. Set to false to prevent narrower buttons. |
| 385 bool ignore_minimum_size_; | 382 bool ignore_minimum_size_; |
| 386 | 383 |
| 387 DISALLOW_COPY_AND_ASSIGN(TextButton); | 384 DISALLOW_COPY_AND_ASSIGN(TextButton); |
| 388 }; | 385 }; |
| 389 | 386 |
| 390 } // namespace views | 387 } // namespace views |
| 391 | 388 |
| 392 #endif // UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ | 389 #endif // UI_VIEWS_CONTROLS_BUTTON_TEXT_BUTTON_H_ |
| OLD | NEW |