Skip to content

Commit

Permalink
Add TODO, see #256
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jul 12, 2024
1 parent 7d5e5f6 commit ad8e402
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions js/buoyancy/view/applications/BuoyancyApplicationsScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default class BuoyancyApplicationsScreenView extends BuoyancyScreenView<B
this.positionResetSceneButton();

// TODO: create in bottle? https://github.com/phetsims/density-buoyancy-common/issues/256
// TODO: Fix units, see https://github.com/phetsims/density-buoyancy-common/issues/256
const customInsideBottleMaterial = Material.createCustomSolidMaterial( {
density: 1000,
densityRange: new Range( 50, 20000 )
Expand Down Expand Up @@ -151,19 +152,23 @@ export default class BuoyancyApplicationsScreenView extends BuoyancyScreenView<B
material => material.custom );

const customBottleDensityControlTandem = materialInsideControlsTandem.createTandem( 'customBottleDensityNumberControl' );
const customBottleDensityControl = new NumberControl( DensityBuoyancyCommonStrings.densityStringProperty, customInsideBottleMaterial.densityProperty, customInsideBottleMaterial.densityProperty.range, combineOptions<NumberControlOptions>( {
visibleProperty: new GatedVisibleProperty( customDensityControlVisibleProperty, customBottleDensityControlTandem ),
sliderOptions: {
accessibleName: DensityBuoyancyCommonStrings.densityStringProperty,
thumbNode: new PrecisionSliderThumb( {
tandem: customBottleDensityControlTandem.createTandem( 'slider' ).createTandem( 'thumbNode' )
} )
},
numberDisplayOptions: {
valuePattern: DensityBuoyancyCommonConstants.KILOGRAMS_PER_VOLUME_PATTERN_STRING_PROPERTY
},
tandem: customBottleDensityControlTandem
}, MaterialMassVolumeControlNode.getNumberControlOptions() ) );
const bottleCustomInsideMaterialDensityControl = new NumberControl(
DensityBuoyancyCommonStrings.densityStringProperty,
customInsideBottleMaterial.densityProperty,
customInsideBottleMaterial.densityProperty.range,
combineOptions<NumberControlOptions>( {
visibleProperty: new GatedVisibleProperty( customDensityControlVisibleProperty, customBottleDensityControlTandem ),
sliderOptions: {
accessibleName: DensityBuoyancyCommonStrings.densityStringProperty,
thumbNode: new PrecisionSliderThumb( {
tandem: customBottleDensityControlTandem.createTandem( 'slider' ).createTandem( 'thumbNode' )
} )
},
numberDisplayOptions: {
valuePattern: DensityBuoyancyCommonConstants.KILOGRAMS_PER_VOLUME_PATTERN_STRING_PROPERTY
},
tandem: customBottleDensityControlTandem
}, MaterialMassVolumeControlNode.getNumberControlOptions() ) );

const airVolumeMaxWidth = ( materialInsideControls.width - DensityBuoyancyCommonConstants.SPACING_SMALL ) / 2;
const airVolumeDisplayTandem = bottleControlsTandem.createTandem( 'airVolumeDisplay' );
Expand All @@ -180,7 +185,7 @@ export default class BuoyancyApplicationsScreenView extends BuoyancyScreenView<B
visibleProperty: materialInsideControls.visibleProperty
} ),
materialInsideControls,
customBottleDensityControl,
bottleCustomInsideMaterialDensityControl,
new HSeparator(),
new HBox( {
tandem: airVolumeDisplayTandem,
Expand Down

0 comments on commit ad8e402

Please sign in to comment.