Skip to content

Commit

Permalink
Add homeSCreenIcon for ChartIntroScreen.ts. See #46.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed May 31, 2023
1 parent 5279863 commit 561e475
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion js/chart-intro/ChartIntroScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import ChartIntroModel from '../chart-intro/model/ChartIntroModel.js';
import ChartIntroScreenView from '../chart-intro/view/ChartIntroScreenView.js';
import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js';
import BuildANucleusStrings from '../BuildANucleusStrings.js';
import ScreenIcon from '../../../joist/js/ScreenIcon.js';
import CompleteNuclideChartIconNode from './view/CompleteNuclideChartIconNode.js';
import { FlowBox } from '../../../scenery/js/imports.js';

// types
export type NuclideChartIntroScreenOptions = ScreenOptions;
Expand All @@ -25,7 +28,9 @@ class ChartIntroScreen extends Screen<ChartIntroModel, ChartIntroScreenView> {
//TODO if you include homeScreenIcon or navigationBarIcon, use JOIST/ScreenIcon
name: BuildANucleusStrings.chartIntroStringProperty,

backgroundColorProperty: BANColors.screenBackgroundColorProperty
backgroundColorProperty: BANColors.screenBackgroundColorProperty,

homeScreenIcon: createScreenIcon()
}, providedOptions );

super(
Expand All @@ -36,5 +41,16 @@ class ChartIntroScreen extends Screen<ChartIntroModel, ChartIntroScreenView> {
}
}

/**
* Creates the icon for this screen.
*/
function createScreenIcon(): ScreenIcon {
const iconNode = new FlowBox( { children: [ new CompleteNuclideChartIconNode() ], margin: 3 } );
return new ScreenIcon( iconNode, {
maxIconWidthProportion: 1,
maxIconHeightProportion: 1
} );
}

buildANucleus.register( 'ChartIntroScreen', ChartIntroScreen );
export default ChartIntroScreen;

0 comments on commit 561e475

Please sign in to comment.