New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes support Reduce motion preference, #3437 #3438
Conversation
Added AccessiblityPreference struct containing methods that make it easy for other code to handle the Reduce motion preference. Modified methods in MainWindowController that support entering and exiting full screen mode and showing and hiding the side bar to suppress animations if Reduce motion has been enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessibility is important; thanks for making these changes. A couple comments, though.
iina/AccessibilityPreference.swift
Outdated
|
||
import Foundation | ||
|
||
struct AccessibilityPreference { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct AccessibilityPreference { | |
struct AccessibilityPreferences { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
iina/AccessibilityPreference.swift
Outdated
/// Adjusts an animation to be instantaneous if the macOS System Preference Reduce motion is enabled. | ||
/// - Parameter duration: Desired animation duration. | ||
/// - Returns: `0` if reduce motion is enabled; otherwise the given duration. | ||
static func adjustDuration(_ duration: TimeInterval) -> TimeInterval { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static func adjustDuration(_ duration: TimeInterval) -> TimeInterval { | |
static func adjustedDuration(_ duration: TimeInterval) -> TimeInterval { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
iina/AccessibilityPreference.swift
Outdated
/// check or uncheck Reduce motion. | ||
/// | ||
/// - Returns: `true` if reduce motion is enabled; otherwise `false`. | ||
static func reduceMotion() -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static func reduceMotion() -> Bool { | |
static var motionReductionEnabled: Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opps. Messed this one up. Missed the bit about switching to computed property. Will drink some coffee and will fix the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3rd commit addresses this review comment properly. Let me know if I need to be rebasing or squashing.
Added AccessiblityPreference struct containing methods that make it
easy for other code to handle the Reduce motion preference.
Modified methods in MainWindowController that support entering and
exiting full screen mode and showing and hiding the side bar to
suppress animations if Reduce motion has been enabled.
Description: