diff --git a/js/common/view/BAMScreenView.js b/js/common/view/BAMScreenView.js index c9e28b21..48d387b5 100644 --- a/js/common/view/BAMScreenView.js +++ b/js/common/view/BAMScreenView.js @@ -115,6 +115,7 @@ class BAMScreenView extends ScreenView { this.updateRefillButton = () => { this.refillButton.enabled = !this.bamModel.currentCollectionProperty.value.currentKitProperty.value.allBucketsFilled(); }; + // @public {ResetAllButton} Create a reset all button. Position of button is adjusted on "Larger" Screen. this.resetAllButton = new ResetAllButton( { listener: () => { @@ -131,6 +132,7 @@ class BAMScreenView extends ScreenView { kitPanel.reset(); if ( this.dialog instanceof Molecule3DDialog ) { this.dialog.isPlayingProperty.reset(); + this.dialog.viewStyleProperty.reset(); } this.updateRefillButton(); @@ -141,8 +143,8 @@ class BAMScreenView extends ScreenView { }, right: this.layoutBounds.right - BAMConstants.VIEW_PADDING / 2, bottom: kitPanel.bottom + BAMConstants.VIEW_PADDING / 4 - } ) - ; + } ); + this.resetAllButton.touchArea = this.resetAllButton.bounds.dilated( 7 ); this.addChild( this.resetAllButton ); this.resetAllButton.moveToBack(); diff --git a/js/common/view/view3d/Molecule3DDialog.js b/js/common/view/view3d/Molecule3DDialog.js index 5bcbec14..583b8551 100644 --- a/js/common/view/view3d/Molecule3DDialog.js +++ b/js/common/view/view3d/Molecule3DDialog.js @@ -63,9 +63,8 @@ class Molecule3DDialog extends Dialog { // @public {BooleanProperty} this.userControlledProperty = new BooleanProperty( false ); - // View styles for space filled and ball and stick views. - const viewStyleProperty = new EnumerationProperty( ViewStyle, ViewStyle.SPACE_FILL ); - //REVIEW: playPauseButton could use a bigger touch area? Maybe the other buttons too in this dialog. + // @public {EnumerationProperty} View styles for space filled and ball and stick views. + this.viewStyleProperty = new EnumerationProperty( ViewStyle, ViewStyle.SPACE_FILL ); const playPauseButton = new PlayPauseButton( this.isPlayingProperty, { radius: 15, valueOffSoundPlayer: Playable.NO_SOUND, @@ -201,7 +200,7 @@ class Molecule3DDialog extends Dialog { // Listener to change the view style to the space filled representation spaceFilledIcon.addInputListener( new PressListener( { press: () => { - viewStyleProperty.value = ViewStyle.SPACE_FILL; + this.viewStyleProperty.value = ViewStyle.SPACE_FILL; } } ) ); @@ -219,7 +218,7 @@ class Molecule3DDialog extends Dialog { // Updates the view style to the ball and stick representation ballAndStickIcon.addInputListener( new PressListener( { press: () => { - viewStyleProperty.value = ViewStyle.BALL_AND_STICK; + this.viewStyleProperty.value = ViewStyle.BALL_AND_STICK; } } ) ); @@ -232,7 +231,7 @@ class Molecule3DDialog extends Dialog { moleculeScene.add( moleculeContainer ); // Handle the each 3D representation based on the current view style - Property.multilink( [ viewStyleProperty, completeMoleculeProperty ], ( viewStyle, completeMolecule ) => { + Property.multilink( [ this.viewStyleProperty, completeMoleculeProperty ], ( viewStyle, completeMolecule ) => { if ( completeMolecule ) { // Remove all previous mesh elements if they exists from a previous build @@ -263,7 +262,7 @@ class Molecule3DDialog extends Dialog { } ]; // Create the icons for scene selection - const sceneRadioButtonGroup = new RadioButtonGroup( viewStyleProperty, toggleButtonsContent, { + const sceneRadioButtonGroup = new RadioButtonGroup( this.viewStyleProperty, toggleButtonsContent, { buttonContentXMargin: 5, buttonContentYMargin: -8, // Trimming of part of the icon node is acceptable in this case. baseColor: 'black',