| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 horizontal_alignment_(gfx::ALIGN_LEFT) { | 97 horizontal_alignment_(gfx::ALIGN_LEFT) { |
| 98 SetAnimationDuration(kHoverAnimationDurationMs); | 98 SetAnimationDuration(kHoverAnimationDurationMs); |
| 99 SetTextInternal(text); | 99 SetTextInternal(text); |
| 100 | 100 |
| 101 AddChildView(ink_drop_container_); | 101 AddChildView(ink_drop_container_); |
| 102 ink_drop_container_->SetPaintToLayer(); | 102 ink_drop_container_->SetPaintToLayer(); |
| 103 ink_drop_container_->layer()->SetFillsBoundsOpaquely(false); | 103 ink_drop_container_->layer()->SetFillsBoundsOpaquely(false); |
| 104 ink_drop_container_->SetVisible(false); | 104 ink_drop_container_->SetVisible(false); |
| 105 | 105 |
| 106 AddChildView(image_); | 106 AddChildView(image_); |
| 107 image_->set_interactive(false); | 107 image_->set_can_process_events_within_subtree(false); |
| 108 | 108 |
| 109 AddChildView(label_); | 109 AddChildView(label_); |
| 110 label_->SetFontList(cached_normal_font_list_); | 110 label_->SetFontList(cached_normal_font_list_); |
| 111 label_->SetAutoColorReadabilityEnabled(false); | 111 label_->SetAutoColorReadabilityEnabled(false); |
| 112 label_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); | 112 label_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); |
| 113 | 113 |
| 114 // Inset the button focus rect from the actual border; roughly match Windows. | 114 // Inset the button focus rect from the actual border; roughly match Windows. |
| 115 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets(3))); | 115 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets(3))); |
| 116 } | 116 } |
| 117 | 117 |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 : PlatformStyle::TextColorForButton(button_state_colors_, *this); | 604 : PlatformStyle::TextColorForButton(button_state_colors_, *this); |
| 605 if (state() != STATE_DISABLED && label_->enabled_color() != color) | 605 if (state() != STATE_DISABLED && label_->enabled_color() != color) |
| 606 label_->SetEnabledColor(color); | 606 label_->SetEnabledColor(color); |
| 607 } | 607 } |
| 608 | 608 |
| 609 bool LabelButton::UseFloodFillInkDrop() const { | 609 bool LabelButton::UseFloodFillInkDrop() const { |
| 610 return !GetText().empty(); | 610 return !GetText().empty(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 } // namespace views | 613 } // namespace views |
| OLD | NEW |