Closed zepumph closed 3 years ago
The top level Property makes sense to actually manipulate the specific visibleProperties, even though those are still instrumented.
So there is a top level Property, and when it changes, it changes the individual NumberControl.visibleProperty for all object types.
This has been implemented above, see
projectileMotion.labScreen.view.projectileControlPanel.diameterNumberControlsVisibleProperty
projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty
So the above Properties will actually set all the individual visibleProperties, like
projectileMotion.labScreen.view.projectileControlPanel.carControl.massNumberControl.visibleProperty
This means that you can have this case, which allows for complete flexibility:
projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty
is trueprojectileMotion.labScreen.view.projectileControlPanel.carControl.massNumberControl.visibleProperty
is set to false, hiding only that single NumberControlprojectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty
is still true, and didn't change from changing the more specific PropertyprojectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty
is set to false, now all controls, are invisible (but the car one didn't change).projectileMotion.labScreen.view.projectileControlPanel.massNumberControlsVisibleProperty
is set to true, now all controls are visible, and all changed (including the car one).This seems great to me.
I also added code so that the panel will resize when NumberControls are hidden here on the lab screen.
Please review.
I created https://github.com/phetsims/projectile-motion/issues/270 to handle displayOnlyProperty.
Thanks @zepumph! I really like how things are behaving in master.
On the lab screen. In the projectile control panel, we want a single Property that would set all Projectile types's mass NumberControl visible. This will directly change the numberControl.visibleProperty.
We also want this for displayOnlyProperty (see https://github.com/phetsims/sun/issues/686#issuecomment-786268389), and enabledProperty.
From #244
Here are notes from today's PhET-iO meeting
Tagging @arouinfar and @kathy-phet