Skip to content
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

Merged
merged 3 commits into from Dec 13, 2021
Merged

Conversation

low-batt
Copy link
Contributor

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:

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.
@low-batt low-batt changed the title Closes support Reduce motion preference, iina#3437 Closes support Reduce motion preference, #3437 Jun 30, 2021
Copy link
Member

@saagarjha saagarjha left a 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.


import Foundation

struct AccessibilityPreference {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct AccessibilityPreference {
struct AccessibilityPreferences {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

/// 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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static func adjustDuration(_ duration: TimeInterval) -> TimeInterval {
static func adjustedDuration(_ duration: TimeInterval) -> TimeInterval {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

/// check or uncheck Reduce motion.
///
/// - Returns: `true` if reduce motion is enabled; otherwise `false`.
static func reduceMotion() -> Bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static func reduceMotion() -> Bool {
static var motionReductionEnabled: Bool {

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@saagarjha saagarjha merged commit d8b08cd into iina:develop Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants