Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: ui/native_theme/native_theme_mac.mm

Issue 2292233002: macviews: apply graphite tint to button colors when needed (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_mac.mm
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm
index 1f757dd1cbe0863f4168fb7714bf091e3978e24f..2a4c6c217b91a02bd52ab625fca8832cc665608f 100644
--- a/ui/native_theme/native_theme_mac.mm
+++ b/ui/native_theme/native_theme_mac.mm
@@ -133,20 +133,20 @@ SkColor NativeThemeMac::GetSystemColor(ColorId color_id) const {
return NSSystemColorToSkColor([NSColor windowBackgroundColor]);
case kColorId_DialogBackground:
return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColor(color_id, this)
+ ? GetAuraColorWithSystemTint(color_id, this)
: kDialogBackgroundColor;
case kColorId_BubbleBackground:
return SK_ColorWHITE;
case kColorId_FocusedBorderColor:
return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColor(color_id, this)
+ ? GetAuraColorWithSystemTint(color_id, this)
: NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
case kColorId_FocusedMenuButtonBorderColor:
return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
case kColorId_UnfocusedBorderColor:
return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColor(color_id, this)
+ ? GetAuraColorWithSystemTint(color_id, this)
: NSSystemColorToSkColor([NSColor controlColor]);
// Buttons and labels.
@@ -161,7 +161,7 @@ SkColor NativeThemeMac::GetSystemColor(ColorId color_id) const {
return NSSystemColorToSkColor([NSColor controlTextColor]);
case kColorId_CallToActionColor:
return ui::MaterialDesignController::IsSecondaryUiMaterial()
- ? GetAuraColor(color_id, this)
+ ? GetAuraColorWithSystemTint(color_id, this)
: NSSystemColorToSkColor([NSColor controlTextColor]);
case kColorId_ButtonDisabledColor:
case kColorId_LabelDisabledColor:
@@ -427,6 +427,12 @@ void NativeThemeMac::PaintStyledGradientButton(SkCanvas* canvas,
canvas->drawDRRect(outer_shape, shape, paint);
}
+SkColor NativeThemeMac::GetAuraColorWithSystemTint(
+ NativeTheme::ColorId color_id,
+ const NativeTheme* base_theme) const {
+ return ApplySystemControlTint(GetAuraColor(color_id, base_theme));
+}
+
NativeThemeMac::NativeThemeMac() {
}
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698