Commit 2d50c791 authored by Thomas Lukaszewicz's avatar Thomas Lukaszewicz Committed by Commit Bot

Fixed color regression for radio and check buttons on Linux GTK

Fixes a regression from http://crrev.com/1925340 , which changed the
toggled color for check and radio buttons to use
kColorId_ButtonEnabledColor instead of kColorId_ProminentButtonColor.

On linux GTK toggled check and radio buttons are expected to use the
prominent button color. Added a checked color id to allow for platform
differences.

Bug: 1057942
Change-Id: Ib14bf40eaf7a895ddebc9c2b670bd50273fbd4dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2185569Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766542}
parent 21fff260
......@@ -232,6 +232,7 @@ base::Optional<SkColor> SkColorFromColorId(
// return GetBgColor("GtkButton#button:hover");
// ProminentButton
case ui::NativeTheme::kColorId_ButtonCheckedColor:
case ui::NativeTheme::kColorId_ProminentButtonColor:
case ui::NativeTheme::kColorId_ProminentButtonFocusedColor:
return GetBgColor(
......
......@@ -33,6 +33,7 @@ base::Optional<SkColor> GetHighContrastColor(
case NativeTheme::kColorId_TabBottomBorder:
return color_scheme == NativeTheme::ColorScheme::kDark ? SK_ColorWHITE
: SK_ColorBLACK;
case NativeTheme::kColorId_ButtonCheckedColor:
case NativeTheme::kColorId_ButtonEnabledColor:
case NativeTheme::kColorId_FocusedBorderColor:
case NativeTheme::kColorId_ProminentButtonColor:
......@@ -68,6 +69,7 @@ base::Optional<SkColor> GetDarkSchemeColor(NativeTheme::ColorId color_id) {
// Button
case NativeTheme::kColorId_ButtonBorderColor:
return gfx::kGoogleGrey800;
case NativeTheme::kColorId_ButtonCheckedColor:
case NativeTheme::kColorId_ButtonEnabledColor:
case NativeTheme::kColorId_ProminentButtonColor:
return gfx::kGoogleBlue300;
......@@ -226,6 +228,7 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
return gfx::kGoogleGrey050;
// Buttons
case NativeTheme::kColorId_ButtonCheckedColor:
case NativeTheme::kColorId_ButtonEnabledColor:
return gfx::kGoogleBlue600;
case NativeTheme::kColorId_ButtonInkDropShadowColor:
......
......@@ -22,12 +22,13 @@
/* Button */ \
OP(kColorId_ButtonColor), \
OP(kColorId_ButtonBorderColor), \
OP(kColorId_ButtonCheckedColor), \
OP(kColorId_ButtonUncheckedColor), \
OP(kColorId_ButtonEnabledColor), \
OP(kColorId_ButtonDisabledColor), \
OP(kColorId_ButtonHoverColor), \
OP(kColorId_ButtonInkDropFillColor), \
OP(kColorId_ButtonInkDropShadowColor), \
OP(kColorId_ButtonUncheckedColor), \
OP(kColorId_ProminentButtonColor), \
OP(kColorId_ProminentButtonDisabledColor), \
OP(kColorId_ProminentButtonFocusedColor), \
......
......@@ -185,7 +185,7 @@ SkPath Checkbox::GetFocusRingPath() const {
SkColor Checkbox::GetIconImageColor(int icon_state) const {
const SkColor active_color = GetNativeTheme()->GetSystemColor(
(icon_state & IconState::CHECKED)
? ui::NativeTheme::kColorId_ButtonEnabledColor
? ui::NativeTheme::kColorId_ButtonCheckedColor
: ui::NativeTheme::kColorId_ButtonUncheckedColor);
return (icon_state & IconState::ENABLED)
? active_color
......
......@@ -923,7 +923,7 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
const gfx::VectorIcon& radio_icon =
toggled ? kMenuRadioSelectedIcon : kMenuRadioEmptyIcon;
const SkColor radio_icon_color = GetNativeTheme()->GetSystemColor(
toggled ? ui::NativeTheme::kColorId_ButtonEnabledColor
toggled ? ui::NativeTheme::kColorId_ButtonCheckedColor
: ui::NativeTheme::kColorId_ButtonUncheckedColor);
radio_check_image_view_->SetImage(
gfx::CreateVectorIcon(radio_icon, kMenuCheckSize, radio_icon_color));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment