Skip to content

Commit

Permalink
Inline COMBO_BOX_TEXT_OPTIONS in MySolarSystemComboBox, see #88
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 10, 2023
1 parent 85a1489 commit 35a257b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions js/common/view/MySolarSystemComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ import MySolarSystemStrings from '../../MySolarSystemStrings.js';
import MySolarSystemModel from '../model/MySolarSystemModel.js';
import { Node, Text } from '../../../../scenery/js/imports.js';

//REVIEW: This is only used once, why not inline it?
const COMBO_BOX_TEXT_OPTIONS = {
font: SolarSystemCommonConstants.PANEL_FONT,
maxWidth: SolarSystemCommonConstants.MAX_WIDTH
};

export default class MySolarSystemComboBox extends ComboBox<LabMode> {
public constructor( model: MySolarSystemModel, listParent: Node ) {

Expand Down Expand Up @@ -76,7 +70,10 @@ export default class MySolarSystemComboBox extends ComboBox<LabMode> {
const nameProperty = modeNameMap.get( mode )!;
return {
value: mode,
createNode: () => new Text( nameProperty, COMBO_BOX_TEXT_OPTIONS ),
createNode: () => new Text( nameProperty, {
font: SolarSystemCommonConstants.PANEL_FONT,
maxWidth: SolarSystemCommonConstants.MAX_WIDTH
} ),
a11yName: nameProperty
};
};
Expand Down

0 comments on commit 35a257b

Please sign in to comment.