Skip to content

Commit

Permalink
Remove navbar earth locale button, see phetsims/chipper#1302
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 23, 2022
1 parent bfd783b commit 7ff277e
Showing 1 changed file with 1 addition and 62 deletions.
63 changes: 1 addition & 62 deletions js/NavigationBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import StringProperty from '../../axon/js/StringProperty.js';
import Dimension2 from '../../dot/js/Dimension2.js';
import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import { AlignBox, Color, FireListener, GridBox, HBox, ManualConstraint, Node, Path, PDOMPeer, Rectangle, RelaxedManualConstraint, Text } from '../../scenery/js/imports.js';
import { AlignBox, Color, HBox, ManualConstraint, Node, PDOMPeer, Rectangle, RelaxedManualConstraint, Text } from '../../scenery/js/imports.js';
import Tandem from '../../tandem/js/Tandem.js';
import A11yButtonsHBox from './A11yButtonsHBox.js';
import HomeButton from './HomeButton.js';
Expand All @@ -43,10 +43,6 @@ import ReadOnlyProperty from '../../axon/js/ReadOnlyProperty.js';
import Bounds2 from '../../dot/js/Bounds2.js';
import Screen from './Screen.js';
import BooleanProperty from '../../axon/js/BooleanProperty.js';
import localeInfoModule from '../../chipper/js/data/localeInfoModule.js';
import localeProperty from './localeProperty.js';
import globeAmericasSolidShape from '../../sherpa/js/fontawesome-5/globeAmericasSolidShape.js';
import Panel from '../../sun/js/Panel.js';

// constants
// for layout of the NavigationBar, used in the following way:
Expand Down Expand Up @@ -133,63 +129,6 @@ class NavigationBar extends Node {
);
this.barContents.addChild( phetButton );

// TODO: Remove as part of https://github.com/phetsims/chipper/issues/1302 work
if ( localeProperty.validValues!.length > 1 ) {
this.localeNode = new Path( globeAmericasSolidShape, {
scale: 0.04,
fill: new DerivedProperty( [ this.navigationBarFillProperty ], color => {
return color.equals( Color.BLACK ) ? 'white' : 'black';
} ),
inputListeners: [
new FireListener( {
fire: () => {
localePopup.visible = !localePopup.visible;
},
tandem: Tandem.OPT_OUT
} )
],
cursor: 'pointer'
} );
this.localeNode.mouseArea = this.localeNode.localBounds.dilated( 5 );
this.localeNode.touchArea = this.localeNode.localBounds.dilated( 5 );

const localePopup = new Panel( new GridBox( {
xMargin: 10,
yMargin: 3,
xAlign: 'left',
autoRows: 15,
children: localeProperty.validValues!.map( locale => {
// @ts-ignore
return new Text( localeInfoModule[ locale ].localizedName, {
font: new PhetFont( 14 ),
cursor: 'pointer',
inputListeners: [
new FireListener( {
fire: () => {
localeProperty.value = locale;
localePopup.visible = false;
},
tandem: Tandem.OPT_OUT
} ),
{
move: () => {
localeProperty.value = locale;
}
}

]
} );
} )
} ), {
visible: false
} );
sim.topLayer.addChild( localePopup );

ManualConstraint.create( sim.rootNode, [ this.localeNode, localePopup ], ( localeNodeProxy, popupProxy ) => {
popupProxy.rightBottom = localeNodeProxy.rightTop;
} );
}

// a11y HBox, button fills determined by state of navigationBarFillProperty
this.a11yButtonsHBox = new A11yButtonsHBox(
sim,
Expand Down

0 comments on commit 7ff277e

Please sign in to comment.