From 498c938707308093178593c2adcdd79ec369d74b Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Fri, 15 Mar 2024 16:12:15 -0600 Subject: [PATCH] add control for showing fluid displaced, https://github.com/phetsims/buoyancy/issues/113 Signed-off-by: Michael Kauzmann --- js/buoyancy/view/BuoyancyLabScreenView.ts | 4 +++- js/common/view/DisplayOptionsNode.ts | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/js/buoyancy/view/BuoyancyLabScreenView.ts b/js/buoyancy/view/BuoyancyLabScreenView.ts index c66f6542..8d1c2f20 100644 --- a/js/buoyancy/view/BuoyancyLabScreenView.ts +++ b/js/buoyancy/view/BuoyancyLabScreenView.ts @@ -54,7 +54,9 @@ export default class BuoyancyLabScreenView extends DensityBuoyancyScreenView | null; }; type DisplayOptionsNodeOptions = SelfOptions & VBoxOptions; @@ -48,6 +52,7 @@ export default class DisplayOptionsNode extends VBox { const options = optionize()( { includeVectorScaleControl: true, + showFluidDisplacedProperty: null, spacing: DensityBuoyancyCommonConstants.MARGIN, align: 'left' }, providedOptions ); @@ -115,7 +120,10 @@ export default class DisplayOptionsNode extends VBox { align: 'left', children: [ new Checkbox( model.showMassesProperty, new Text( DensityBuoyancyCommonStrings.massesStringProperty, labelOptions ), checkboxOptions ), - new Checkbox( model.showForceValuesProperty, new Text( DensityBuoyancyCommonStrings.forceValuesStringProperty, labelOptions ), checkboxOptions ) + new Checkbox( model.showForceValuesProperty, new Text( DensityBuoyancyCommonStrings.forceValuesStringProperty, labelOptions ), checkboxOptions ), + ...( options.showFluidDisplacedProperty ? + [ new Checkbox( options.showFluidDisplacedProperty, new Text( DensityBuoyancyCommonStrings.fluidDisplacedStringProperty, labelOptions ), checkboxOptions ) ] : + [] ) ] } ) ]