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

Fix <Image> tintColor #408

Merged
merged 41 commits into from
May 21, 2020
Merged

Fix <Image> tintColor #408

merged 41 commits into from
May 21, 2020

Conversation

tom-un
Copy link
Collaborator

@tom-un tom-un commented May 21, 2020

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

The macOS version of <Image> never supported the tintColor prop. Since macOS 10.14 there is now NSImageView tint support, so map the react-native prop.

This fix is branched off the #407 fix, so i contains all the diffs from that PR as well. When the 407 PR completes, I'll merge it into this branch.

Fixes #315

Changelog

[macOS] [Fixed] - Fix <Image> tintColor

Test Plan

tint

Microsoft Reviewers: Open in CodeFlow

tom-un and others added 30 commits April 3, 2020 20:53
@tom-un tom-un requested a review from HeyImChris May 21, 2020 02:03
@property (nonatomic, copy) RCTDirectEventBlock onDragEnter;
@property (nonatomic, copy) RCTDirectEventBlock onDragLeave;
@property (nonatomic, copy) RCTDirectEventBlock onDrop;
@property (nonatomic, strong) RCTUIColor *tintColor;

Choose a reason for hiding this comment

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

Since this is in a TARGET_OS_OSX block, just use NSColor directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea.

@property (nonatomic, copy) RCTDirectEventBlock onDragEnter;
@property (nonatomic, copy) RCTDirectEventBlock onDragLeave;
@property (nonatomic, copy) RCTDirectEventBlock onDrop;
@property (nonatomic, strong) RCTUIColor *tintColor;

Choose a reason for hiding this comment

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

Are we matching another property with strong? Or should we just be using copy since NSColor conforms to NSCopying

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was mimicking the tintColor property of UIView, but you're right, it should really be the same as the contentTintColor of NSImageView and other NSColor properties in AppKit. Also, RCTImageview doesn't need an ivar, it should just return the underlying NSImageView's contentTintColor.

@tom-un tom-un merged commit ee78435 into microsoft:master May 21, 2020
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.

[Image] tintColor does not work on macOS
3 participants