2024-07-24 12:38:22 +00:00
|
|
|
import * as deprecate from '@electron/internal/common/deprecate';
|
2020-07-28 18:03:30 +00:00
|
|
|
const { systemPreferences } = process._linkedBinding('electron_browser_system_preferences');
|
2019-08-14 20:42:55 +00:00
|
|
|
|
2020-03-18 01:06:52 +00:00
|
|
|
if ('getEffectiveAppearance' in systemPreferences) {
|
2020-12-08 07:07:04 +00:00
|
|
|
const nativeEAGetter = systemPreferences.getEffectiveAppearance;
|
2020-07-28 18:03:30 +00:00
|
|
|
Object.defineProperty(systemPreferences, 'effectiveAppearance', {
|
2020-03-18 01:06:52 +00:00
|
|
|
get: () => nativeEAGetter.call(systemPreferences)
|
|
|
|
});
|
2019-08-14 20:42:55 +00:00
|
|
|
}
|
|
|
|
|
2024-07-24 12:38:22 +00:00
|
|
|
if ('accessibilityDisplayShouldReduceTransparency' in systemPreferences) {
|
|
|
|
const reduceTransparencyDeprecated = deprecate.warnOnce('systemPreferences.accessibilityDisplayShouldReduceTransparency', 'nativeTheme.prefersReducedTransparency');
|
|
|
|
const nativeReduceTransparency = systemPreferences.accessibilityDisplayShouldReduceTransparency;
|
|
|
|
Object.defineProperty(systemPreferences, 'accessibilityDisplayShouldReduceTransparency', {
|
|
|
|
get: () => {
|
|
|
|
reduceTransparencyDeprecated();
|
|
|
|
return nativeReduceTransparency;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-07-28 18:03:30 +00:00
|
|
|
export default systemPreferences;
|