feat: add transparency checking to nativeTheme
(#43024)
* feat: add transparency checking to nativeTheme
Refs 4684870
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
* chore: deprecate previous function
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
* chore: fix lint
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
202536da2f
commit
f8c640d386
8 changed files with 48 additions and 2 deletions
|
@ -68,6 +68,10 @@ bool NativeTheme::InForcedColorsMode() {
|
|||
return ui_theme_->InForcedColorsMode();
|
||||
}
|
||||
|
||||
bool NativeTheme::GetPrefersReducedTransparency() {
|
||||
return ui_theme_->GetPrefersReducedTransparency();
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
const CFStringRef WhiteOnBlack = CFSTR("whiteOnBlack");
|
||||
const CFStringRef UniversalAccessDomain = CFSTR("com.apple.universalaccess");
|
||||
|
@ -108,7 +112,9 @@ gin::ObjectTemplateBuilder NativeTheme::GetObjectTemplateBuilder(
|
|||
&NativeTheme::ShouldUseHighContrastColors)
|
||||
.SetProperty("shouldUseInvertedColorScheme",
|
||||
&NativeTheme::ShouldUseInvertedColorScheme)
|
||||
.SetProperty("inForcedColorsMode", &NativeTheme::InForcedColorsMode);
|
||||
.SetProperty("inForcedColorsMode", &NativeTheme::InForcedColorsMode)
|
||||
.SetProperty("prefersReducedTransparency",
|
||||
&NativeTheme::GetPrefersReducedTransparency);
|
||||
}
|
||||
|
||||
const char* NativeTheme::GetTypeName() {
|
||||
|
|
|
@ -46,6 +46,7 @@ class NativeTheme : public gin::Wrappable<NativeTheme>,
|
|||
bool ShouldUseHighContrastColors();
|
||||
bool ShouldUseInvertedColorScheme();
|
||||
bool InForcedColorsMode();
|
||||
bool GetPrefersReducedTransparency();
|
||||
|
||||
// ui::NativeThemeObserver:
|
||||
void OnNativeThemeUpdated(ui::NativeTheme* theme) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue