Skip to content

Commit

Permalink
Simplified colors + inverted colors for HomeButton, see #222
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 5, 2015
1 parent b68ed21 commit 83ae146
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions js/HomeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ define( function( require ) {
var JoistButton = require( 'JOIST/JoistButton' );
var Property = require( 'AXON/Property' );

function HomeButton( fill, pressedFill, invertedFill, invertedPressedFill, lookAndFeel, model, options ) {
function HomeButton( lookAndFeel, model, options ) {

var homeIcon = new FontAwesomeNode( 'home', {
scale: 0.75
} );
Expand All @@ -30,12 +31,11 @@ define( function( require ) {
JoistButton.call( this, homeIcon, lookAndFeel, options );

Property.multilink( [ this.interactionStateProperty, lookAndFeel.navigationBarFillProperty ], function( interactionState, navigationBarFill ) {
var useInvertedColors = navigationBarFill !== 'black';
if ( !useInvertedColors ) {
homeIcon.fill = interactionState === 'pressed' ? pressedFill : fill;
if ( navigationBarFill === 'black' ) {
homeIcon.fill = interactionState === 'pressed' ? 'gray' : 'white';
}
else {
homeIcon.fill = interactionState === 'pressed' ? invertedPressedFill : invertedFill;
homeIcon.fill = interactionState === 'pressed' ? '#444' : '#222';
}
} );
}
Expand Down
2 changes: 1 addition & 1 deletion js/NavigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ define( function( require ) {
this.addChild( this.buttonHBox );

//add the home button
this.homeButton = new HomeButton( 'white', 'gray', '#222', '#444', sim.lookAndFeel, sim );
this.homeButton = new HomeButton( sim.lookAndFeel, sim );
this.addChild( this.homeButton );

// if the branding specifies to show "adapted from PhET" in the navbar, show it here
Expand Down
4 changes: 1 addition & 3 deletions js/Sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,7 @@ define( function( require ) {
// Resize the layer with all of the dialogs, etc.
sim.topLayer.setScaleMagnitude( scale );

if ( sim.homeScreen ) {
sim.homeScreen.view.layoutWithScale( scale, width, height );
}
sim.homeScreen && sim.homeScreen.view.layoutWithScale( scale, width, height );

// Startup can give spurious resizes (seen on ipad), so defer to the animation loop for painting

Expand Down

0 comments on commit 83ae146

Please sign in to comment.