| Index: ui/views/controls/combobox/combobox.cc
|
| diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
|
| index 615318fe42c1d7e1a549b7f3fbd8387b5a41eb3f..1b28e19ed5d09b1900d2561e726133a608223426 100644
|
| --- a/ui/views/controls/combobox/combobox.cc
|
| +++ b/ui/views/controls/combobox/combobox.cc
|
| @@ -27,9 +27,9 @@
|
| #include "ui/native_theme/native_theme.h"
|
| #include "ui/native_theme/native_theme_aura.h"
|
| #include "ui/resources/grit/ui_resources.h"
|
| -#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
|
| #include "ui/views/animation/ink_drop_highlight.h"
|
| #include "ui/views/animation/ink_drop_impl.h"
|
| +#include "ui/views/animation/ink_drop_ripple.h"
|
| #include "ui/views/background.h"
|
| #include "ui/views/controls/button/custom_button.h"
|
| #include "ui/views/controls/button/label_button.h"
|
| @@ -95,6 +95,12 @@ bool UseMd() {
|
| return ui::MaterialDesignController::IsSecondaryUiMaterial();
|
| }
|
|
|
| +SkColor GetTextColorForEnableState(bool enabled, ui::NativeTheme* theme) {
|
| + return style::GetColor(style::CONTEXT_TEXTFIELD,
|
| + enabled ? style::STYLE_PRIMARY : style::STYLE_DISABLED,
|
| + theme);
|
| +}
|
| +
|
| gfx::Rect PositionArrowWithinContainer(const gfx::Rect& container_bounds,
|
| const gfx::Size& arrow_size,
|
| Combobox::Style style) {
|
| @@ -142,7 +148,7 @@ class TransparentButton : public CustomButton {
|
| return hover_animation().GetCurrentValue();
|
| }
|
|
|
| - // Overridden from InkDropHost:
|
| + // InkDropHost:
|
| std::unique_ptr<InkDrop> CreateInkDrop() override {
|
| std::unique_ptr<views::InkDropImpl> ink_drop = CreateDefaultInkDropImpl();
|
| ink_drop->SetShowHighlightOnHover(false);
|
| @@ -150,12 +156,12 @@ class TransparentButton : public CustomButton {
|
| }
|
|
|
| std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override {
|
| - return std::unique_ptr<views::InkDropRipple>(
|
| - new views::FloodFillInkDropRipple(
|
| - size(), GetInkDropCenterBasedOnLastEvent(),
|
| - GetNativeTheme()->GetSystemColor(
|
| - ui::NativeTheme::kColorId_LabelEnabledColor),
|
| - ink_drop_visible_opacity()));
|
| + return CreateFloodFillInkDropRipple();
|
| + }
|
| +
|
| + SkColor GetInkDropBaseColor() const override {
|
| + return GetNativeTheme()->GetSystemColor(
|
| + ui::NativeTheme::kColorId_LabelEnabledColor);
|
| }
|
|
|
| private:
|
| @@ -815,12 +821,7 @@ void Combobox::PaintText(gfx::Canvas* canvas) {
|
| int x = insets.left();
|
| int y = insets.top();
|
| int text_height = height() - insets.height();
|
| - SkColor text_color = GetNativeTheme()->GetSystemColor(
|
| - UseMd() ? (enabled() ? ui::NativeTheme::kColorId_TextfieldDefaultColor
|
| - : ui::NativeTheme::kColorId_TextfieldReadOnlyColor)
|
| - : (enabled() ? ui::NativeTheme::kColorId_LabelEnabledColor
|
| - : ui::NativeTheme::kColorId_LabelDisabledColor));
|
| -
|
| + SkColor text_color = GetTextColorForEnableState(enabled(), GetNativeTheme());
|
| DCHECK_GE(selected_index_, 0);
|
| DCHECK_LT(selected_index_, model()->GetItemCount());
|
| if (selected_index_ < 0 || selected_index_ > model()->GetItemCount())
|
| @@ -863,8 +864,7 @@ void Combobox::PaintText(gfx::Canvas* canvas) {
|
| path.rLineTo(height, -height);
|
| path.close();
|
| cc::PaintFlags flags;
|
| - SkColor arrow_color = GetNativeTheme()->GetSystemColor(
|
| - ui::NativeTheme::kColorId_ButtonEnabledColor);
|
| + SkColor arrow_color = GetTextColorForEnableState(true, GetNativeTheme());
|
| if (!enabled())
|
| arrow_color = SkColorSetA(arrow_color, gfx::kDisabledControlAlpha);
|
| flags.setColor(arrow_color);
|
|
|