Disable animations in BlueprintJS? - blueprintjs

Is there a way to disable animations completely for a component? Our use case is we want to use Popover, but we don't want the extra time baked in for animations to take place. We want the show/hide to be instant.
Should I override the CSS here, or is there a better hook to do this?

You should be able to adjust the opening/closing delay for the popover by setting the props hoverOpenDelay and hoverCloseDelay to 0.

Related

How to deactivate click event on Unity Slider UI?

In Unity, I would like to use the slider in my canvas but only the handle.
A default behaviour is that if the user clicks on a certain point in the slider , the handle will jump right to that point. I would like to disable this behaviour, allowing the user only to drag the handle to move it.
How can this be done?
Thank you.
Simply uncheck the Raycast Target property of the Image component located on the Background GameObject.
Otherwise you could always override the Slider class to fit your need but i guess this would be a bit overkill in your case.
Hope this helps,
Disable interactable checkbox in inspector. This option added with new versions.

(NSWindowButton) NSWindow.standardWindowButton button not highlighting

When i use the following to create a button
NSWindow.standardWindowButton(NSWindowButton.ZoomButton, forStyleMask: 0)
I get a button that doesn't react to mouse hover events. I can augment this by creating a container view with a NSTrackingArea and manually triggering the highlight method but it produces a clicked state.
Is there a way to somehow force the button into the expected behavior state without the darkened background?
I have been trying to avoid subclassing NSButton, but it seems like i may have to, and I'm just in a state of denial.
I could not get this working for the life of me so my solution was to write my own custom buttons. This works fine for me because my NSWindow is already custom so there wont be a clash of style.
https://gist.github.com/icodeforlove/a334884e59784b4c2567
Another viable solution is to use https://github.com/indragiek/INAppStoreWindow as #xhruso00 mentioned, but it seemed like overkill.

Trying to add my animation to my idle state, but it just keeps saying "None(Motion)"

I have pulled the animation to the Motion tab both by dragging and trough the select motion search function but neither makes the animation stick to my idle state. Can someone give me a pointer to what im doing wrong?
One reason could be that the animations are marked as legacy.
Select one or many animation, in the inspector next to the lock, right click, then Debug. Untick the Legacy. No need to save or else.
The animation which you're trying to set is for another model!
You should use an animation that is for the model.
Or if you insist on using that animation select animation from assets and do a "Control + D" to duplicate it and use new one.
Use the Animator, not the animation controller. I made this mistake when I was following a tutorial. This is only relevant if you are animating .anim files within unity itself. Animation controller is the way to go if you import animations for your specific model.

Unity animation events

I have an animation and I want to show several time hints at certain points.
What is the best way of doing that?
I tried to make events in animation.. and call function which should notify the main GUI class, that something changed, but I am not sure if it is a good solution.
(actually I do not know how to do it effectively).
Or I can make a loop in my main GUI class, just reacting to time.. but I am not sure if the synchronization will be ok.
If it is a cutscene like animation, I would use these animation events. This way it is easy to edit it later, if something changes in the animation. If you calculate seconds in the code while playing the animation, it will be a maintenance hell.

Animating setHidden: on NSView via Cocoa bindings

I'm currently putting the final touches on a project.
A lot (if not all) of the UI logic currently relies on Cocoa Bindings.
Some of the user interface elements (labels, buttons, etc.) have their "Hidden" bindings defined. When certain events are triggered, these elements visibility is toggled.
I'm trying to animate the visibility change (by animating the opacity and maybe even the scale). This could easily be accomplished in a number of ways, either by setting the relevant layer properties, adding the animations to the layer, etc. However, since I'm trying to totally rely on the bindings behavior I "can't" really do this directly.
I tried an implementation using Layer actions, by defining actions for the keys kCAOnOrderIn and kCAOnOrderOut on the relevant elements, but it really didn't work, as the setHidden: is most likely being triggered on the NSView instead of the CALayer -- which makes sense.
So, my question is: how would you animate setHidden: on a NSView, when setHidden: is being invoked by the Cocoa Bindings.
Thank you.
This will fade out an NSView...
[[someView animator] setAlphaValue:0.0f];
Animating setHidden will have no visual effect since it's either on or off. If you want to animate visibility, use setAlpha (or setOpacity on the layer) instead. These take a value between 0.0 and 1.0. If you need the hidden flag to get set for the sake of state information, call -performSelector:withObject:afterDelay passing it a selector that sets the hidden value to whatever you need it to be after the animation has completed. Alternatively you can set up a delegate for explicit animation to be called back when the animation finishes and call setHidden then.
I would suggest taking a look at NSViewAnimation. It takes any NSView and can animate the frame, size or visibility.

Resources