| 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_LABEL_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void SetStyle(ButtonStyle style); | 78 void SetStyle(ButtonStyle style); |
| 79 | 79 |
| 80 // Set the spacing between the image and the text. Shrinking the spacing | 80 // Set the spacing between the image and the text. Shrinking the spacing |
| 81 // will not shrink the overall button size, as it is monotonically increasing. | 81 // will not shrink the overall button size, as it is monotonically increasing. |
| 82 // Call SetMinSize(gfx::Size()) to clear the size if needed. | 82 // Call SetMinSize(gfx::Size()) to clear the size if needed. |
| 83 void SetImageLabelSpacing(int spacing); | 83 void SetImageLabelSpacing(int spacing); |
| 84 | 84 |
| 85 void SetFocusPainter(scoped_ptr<Painter> focus_painter); | 85 void SetFocusPainter(scoped_ptr<Painter> focus_painter); |
| 86 Painter* focus_painter() { return focus_painter_.get(); } | 86 Painter* focus_painter() { return focus_painter_.get(); } |
| 87 | 87 |
| 88 // Set whether the label should ignore the vertical overlap with the border. |
| 89 // Default is true. |
| 90 void set_ignore_vertical_overlap(bool ignore_vertical_overlap) { |
| 91 ignore_vertical_overlap_ = ignore_vertical_overlap; |
| 92 } |
| 93 |
| 88 // View: | 94 // View: |
| 89 void SetBorder(scoped_ptr<Border> border) override; | 95 void SetBorder(scoped_ptr<Border> border) override; |
| 90 gfx::Size GetPreferredSize() const override; | 96 gfx::Size GetPreferredSize() const override; |
| 91 int GetHeightForWidth(int w) const override; | 97 int GetHeightForWidth(int w) const override; |
| 92 void Layout() override; | 98 void Layout() override; |
| 93 const char* GetClassName() const override; | 99 const char* GetClassName() const override; |
| 94 | 100 |
| 95 protected: | 101 protected: |
| 96 ImageView* image() const { return image_; } | 102 ImageView* image() const { return image_; } |
| 97 Label* label() const { return label_; } | 103 Label* label() const { return label_; } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 190 |
| 185 // The button's overall style. | 191 // The button's overall style. |
| 186 ButtonStyle style_; | 192 ButtonStyle style_; |
| 187 | 193 |
| 188 // True if current border was set by UpdateThemedBorder. Defaults to true. | 194 // True if current border was set by UpdateThemedBorder. Defaults to true. |
| 189 bool border_is_themed_border_; | 195 bool border_is_themed_border_; |
| 190 | 196 |
| 191 // Spacing between the image and the text. | 197 // Spacing between the image and the text. |
| 192 int image_label_spacing_; | 198 int image_label_spacing_; |
| 193 | 199 |
| 200 // Indicates if the label should ignore the vertical overlap with the border. |
| 201 bool ignore_vertical_overlap_; |
| 202 |
| 194 scoped_ptr<Painter> focus_painter_; | 203 scoped_ptr<Painter> focus_painter_; |
| 195 | 204 |
| 196 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 205 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
| 197 }; | 206 }; |
| 198 | 207 |
| 199 } // namespace views | 208 } // namespace views |
| 200 | 209 |
| 201 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 210 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| OLD | NEW |