Skip to content

Commit

Permalink
hide Shift for Diffusion, #215
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Apr 17, 2024
1 parent ffb2be7 commit 36b37ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions js/common/view/GasPropertiesSpinnerHelpSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,33 @@ import KeyboardHelpIconFactory from '../../../../scenery-phet/js/keyboard/help/K

export default class GasPropertiesSpinnerHelpSection extends KeyboardHelpSection {

public constructor( orientation: 'horizontal' | 'vertical' ) {
public constructor( orientation: 'horizontal' | 'vertical', includeShift = true ) {

const arrowKeysIcons = ( orientation === 'vertical' ) ? KeyboardHelpIconFactory.upDownArrowKeysRowIcon() :
KeyboardHelpIconFactory.leftRightArrowKeysRowIcon();

const rows = [];

// Adjust
const adjustValueRow = KeyboardHelpSectionRow.labelWithIcon( 'Adjust value', arrowKeysIcons );
rows.push( adjustValueRow );

// Adjust in smaller steps
const adjustInSmallerStepsRow = KeyboardHelpSectionRow.labelWithIcon( 'Adjust in smaller steps',
KeyboardHelpIconFactory.shiftPlusIcon( arrowKeysIcons ) );
if ( includeShift ) {
const adjustInSmallerStepsRow = KeyboardHelpSectionRow.labelWithIcon( 'Adjust in smaller steps',
KeyboardHelpIconFactory.shiftPlusIcon( arrowKeysIcons ) );
rows.push( adjustInSmallerStepsRow );
}

// Jump to minimum
const jumpToMinimumRow = KeyboardHelpSectionRow.labelWithIcon( 'Jump to minimum', TextKeyNode.home() );
rows.push( jumpToMinimumRow );

// Jump to maximum
const jumpToMaximumRow = KeyboardHelpSectionRow.labelWithIcon( 'Jump to maximum', TextKeyNode.end() );
rows.push( jumpToMaximumRow );

super( 'Spinner Controls', [
adjustValueRow,
adjustInSmallerStepsRow,
jumpToMinimumRow,
jumpToMaximumRow
] );
super( 'Spinner Controls', rows );
}
}

Expand Down
2 changes: 1 addition & 1 deletion js/diffusion/view/DiffusionKeyboardHelpContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class DiffusionKeyboardHelpContent extends TwoColumnKeyboardHelpC
new MoveDraggableItemsKeyboardHelpSection(),

// Spinner Controls
new GasPropertiesSpinnerHelpSection( 'vertical' )
new GasPropertiesSpinnerHelpSection( 'vertical', false /* includeShift */ )
];

// Sections in the right column.
Expand Down

0 comments on commit 36b37ef

Please sign in to comment.