feat: expose app accessibility transparency settings api (#39631)
* feat: expose app accessibility transparency settings api * docs: fix typo * chore: add doc * change to property * add as property instead of method * chore: fix lint * rename function name in header --------- Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
This commit is contained in:
parent
463586a6c5
commit
7685f27b31
5 changed files with 13 additions and 2 deletions
|
@ -95,6 +95,9 @@ gin::ObjectTemplateBuilder SystemPreferences::GetObjectTemplateBuilder(
|
|||
.SetMethod("isTrustedAccessibilityClient",
|
||||
&SystemPreferences::IsTrustedAccessibilityClient)
|
||||
.SetMethod("askForMediaAccess", &SystemPreferences::AskForMediaAccess)
|
||||
.SetProperty(
|
||||
"accessibilityDisplayShouldReduceTransparency",
|
||||
&SystemPreferences::AccessibilityDisplayShouldReduceTransparency)
|
||||
#endif
|
||||
.SetMethod("getAnimationSettings",
|
||||
&SystemPreferences::GetAnimationSettings);
|
||||
|
|
|
@ -96,6 +96,7 @@ class SystemPreferences
|
|||
gin::Arguments* args);
|
||||
void RemoveUserDefault(const std::string& name);
|
||||
bool IsSwipeTrackingFromScrollEventsEnabled();
|
||||
bool AccessibilityDisplayShouldReduceTransparency();
|
||||
|
||||
std::string GetSystemColor(gin_helper::ErrorThrower thrower,
|
||||
const std::string& color);
|
||||
|
|
|
@ -598,4 +598,9 @@ v8::Local<v8::Value> SystemPreferences::GetEffectiveAppearance(
|
|||
isolate, [NSApplication sharedApplication].effectiveAppearance);
|
||||
}
|
||||
|
||||
bool SystemPreferences::AccessibilityDisplayShouldReduceTransparency() {
|
||||
return [[NSWorkspace sharedWorkspace]
|
||||
accessibilityDisplayShouldReduceTransparency];
|
||||
}
|
||||
|
||||
} // namespace electron::api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue