| Index: ui/views/controls/button/label_button_border.cc
|
| diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc
|
| index 133105c7c27d104d5a5c61fc5f08bd436515b8e8..ef827667f9e119114afaac3ba7f2c2eae4ba1ef3 100644
|
| --- a/ui/views/controls/button/label_button_border.cc
|
| +++ b/ui/views/controls/button/label_button_border.cc
|
| @@ -31,7 +31,7 @@ const int kTextHoveredImages[] = IMAGE_GRID(IDR_TEXTBUTTON_HOVER);
|
| const int kTextPressedImages[] = IMAGE_GRID(IDR_TEXTBUTTON_PRESSED);
|
|
|
| Button::ButtonState GetButtonState(ui::NativeTheme::State state) {
|
| - switch(state) {
|
| + switch (state) {
|
| case ui::NativeTheme::kDisabled: return Button::STATE_DISABLED;
|
| case ui::NativeTheme::kHovered: return Button::STATE_HOVERED;
|
| case ui::NativeTheme::kNormal: return Button::STATE_NORMAL;
|
| @@ -67,6 +67,7 @@ void PaintHelper(LabelButtonBorder* border,
|
| LabelButtonBorder::LabelButtonBorder(Button::ButtonStyle style)
|
| : style_(style) {
|
| if (style == Button::STYLE_BUTTON) {
|
| + set_insets(gfx::Insets(9, 13, 9, 13));
|
| SetPainter(false, Button::STATE_NORMAL,
|
| Painter::CreateImageGridPainter(kNormalImages));
|
| SetPainter(false, Button::STATE_HOVERED,
|
| @@ -84,17 +85,19 @@ LabelButtonBorder::LabelButtonBorder(Button::ButtonStyle style)
|
| SetPainter(true, Button::STATE_DISABLED,
|
| Painter::CreateImageGridPainter(kDisabledImages));
|
| } else if (style == Button::STYLE_TEXTBUTTON) {
|
| + set_insets(gfx::Insets(5, 6, 5, 6));
|
| SetPainter(false, Button::STATE_HOVERED,
|
| Painter::CreateImageGridPainter(kTextHoveredImages));
|
| SetPainter(false, Button::STATE_PRESSED,
|
| Painter::CreateImageGridPainter(kTextPressedImages));
|
| + } else if (style == Button::STYLE_NATIVE_TEXTBUTTON) {
|
| + set_insets(gfx::Insets(5, 12, 5, 12));
|
| }
|
| }
|
|
|
| LabelButtonBorder::~LabelButtonBorder() {}
|
|
|
| void LabelButtonBorder::Paint(const View& view, gfx::Canvas* canvas) {
|
| - DCHECK(!strcmp(view.GetClassName(), LabelButton::kViewClassName));
|
| const NativeThemeDelegate* native_theme_delegate =
|
| static_cast<const LabelButton*>(&view);
|
| ui::NativeTheme::Part part = native_theme_delegate->GetThemePart();
|
| @@ -127,15 +130,7 @@ void LabelButtonBorder::Paint(const View& view, gfx::Canvas* canvas) {
|
| }
|
|
|
| gfx::Insets LabelButtonBorder::GetInsets() const {
|
| - // Return the style-specific insets between button contents and edges.
|
| - if (style() == Button::STYLE_BUTTON)
|
| - return gfx::Insets(9, 13, 9, 13);
|
| - if (style() == Button::STYLE_TEXTBUTTON)
|
| - return gfx::Insets(5, 6, 5, 6);
|
| - if (style() == Button::STYLE_NATIVE_TEXTBUTTON)
|
| - return gfx::Insets(5, 12, 5, 12);
|
| - NOTREACHED();
|
| - return gfx::Insets();
|
| + return insets_;
|
| }
|
|
|
| Painter* LabelButtonBorder::GetPainter(bool focused,
|
|
|