-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fire button and shield button animations #476
Conversation
@@ -2738,6 +2755,29 @@ | |||
path = View; | |||
sourceTree = "<group>"; | |||
}; | |||
AA7EB6EE27E880EA00036718 /* Animations */ = { |
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.
I moved animations to their own subfolder. My apology for the harder readability of this PR because of this
|
||
@Published var isAnimationViewVisible = false | ||
|
||
override var image: NSImage? { |
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.
In case something sets the image while animation is in progress
import Lottie | ||
import Combine | ||
|
||
final class MouseOverAnimationButton: AddressBarButton { |
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.
This class encapsulates the mouse over animation. Developer only sets animationNames
and class loads and runs animation as necessary.
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.
Looks good overall but I found a minor visual glitch (see attachment)
screencast.2022-03-25.16-13-15.mp4
@@ -417,7 +418,7 @@ extension AddressBarViewController { | |||
|
|||
if let point = self.view.mouseLocationInsideBounds(event.locationInWindow) { | |||
guard self.view.window?.firstResponder !== addressBarTextField.currentEditor(), | |||
!(self.view.hitTest(point) is NSButton) | |||
!(self.view.hitTest(point) is NSButton || self.view.hitTest(point) is AnimationView) |
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.
I suggest moving this as a var of a private NSView extension something like shouldShowArrowCursor in sake of effeciency and readability
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.
Good suggestion 👍 thanks
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.
LGTM. Works like a charm! 🔥
Task/Issue URL: https://app.asana.com/0/0/1201945397495594/f
Description:
Fire button and shield button animates if mouse cursor is over
Steps to test this PR:
Test fire button mouse over animation
Test shield mouse over animation
Internal references:
Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM