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

Set opacity doesn't show up in launched sim if item was disabled #189

Closed
KatieWoe opened this issue Jul 29, 2020 · 2 comments
Closed

Set opacity doesn't show up in launched sim if item was disabled #189

KatieWoe opened this issue Jul 29, 2020 · 2 comments
Assignees

Comments

@KatieWoe
Copy link
Contributor

For phetsims/qa#514. Found on Win 10 Chrome and Mac 10.12 Chrome.
In studio, if you disable something the opacity of that thing may change. If you also change the opacity of that disabled object, then the launched/downloaded version of the sim will have the default disabled opacity rather than the opacity you set.

Steps:

  1. Go to the second screen in Studio
  2. Disable the Ratio checkbox with phScale.microScreen.view.beakerControlPanel.ratioCheckbox.enabledProperty
  3. Observe new opacity
  4. Change the ratio checkbox's opacity with phScale.microScreen.view.beakerControlPanel.ratioCheckbox.opacityProperty What you change it too doesn't really matter, as long as you can see the difference.
  5. Launch the sim and observe the checkbox.

This does not seem to happen if the item was not disabled.
setopacityitems

@pixelzoom
Copy link
Contributor

pixelzoom commented Jul 29, 2020

This is the expected behavior with all scenery Nodes and common-code UI components. Setting enabledProperty adjusts opacity. If you try to adjust both, then your opacity changes will be overwritten when state is restored.

Imo, we shouldn't be exposing opacityProperty for every Node (featured or not), or it should at least be phetioReadOnly:true by default. We should ensure that all UI components have an enabledProperty, with consistent behavior, implemented via the EnabledComponent mixin. And we should make opacityProperty phetioReadOnly:false only when there's a good reason to do so.

Assigning to @arouinfar to decide how to proceed. If you'd like to address this generally, please create a scenery issue, identify whether it's blocking, and link to this issue.

@arouinfar
Copy link
Contributor

This is not a blocking issue @pixelzoom, and the sim is behaving as expected. See phetsims/scenery#1047 for a general discussion about (un)instrumenting opacityProperty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants