зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1475462 - Implement prefers-reduced-motion for MacOSX. r=mstange
The local declaration part was done by jfkthame. Differential Revision: https://phabricator.services.mozilla.com/D4499 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
804a02dafb
Коммит
08a872d1f5
|
@ -32,6 +32,11 @@ typedef NSInteger mozNSScrollerStyle;
|
|||
+ (mozNSScrollerStyle)preferredScrollerStyle;
|
||||
@end
|
||||
|
||||
// Available from 10.12 onwards; test availability at runtime before using
|
||||
@interface NSWorkspace(AvailableSinceSierra)
|
||||
@property (readonly) BOOL accessibilityDisplayShouldReduceMotion;
|
||||
@end
|
||||
|
||||
nsLookAndFeel::nsLookAndFeel()
|
||||
: nsXPLookAndFeel()
|
||||
, mUseOverlayScrollbars(-1)
|
||||
|
@ -544,6 +549,14 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
|||
case eIntID_SystemUsesDarkTheme:
|
||||
aResult = SystemWantsDarkTheme();
|
||||
break;
|
||||
case eIntID_PrefersReducedMotion:
|
||||
aResult = 0;
|
||||
if ([[NSWorkspace sharedWorkspace] respondsToSelector:@selector(
|
||||
accessibilityDisplayShouldReduceMotion)]) {
|
||||
aResult =
|
||||
[[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion] ? 1 : 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
aResult = 0;
|
||||
res = NS_ERROR_FAILURE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче