Skip to content

Commit

Permalink
refactor lineWrap constant so it is shared, see #249
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Jan 7, 2023
1 parent ac451f7 commit fe5a582
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/quadrilateral/view/MoveShapeHelpSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import KeyboardHelpSectionRow from '../../../../scenery-phet/js/keyboard/help/Ke
import quadrilateral from '../../quadrilateral.js';
import QuadrilateralStrings from '../../QuadrilateralStrings.js';
import { Text } from '../../../../scenery/js/imports.js';
import QuadrilateralKeyboardHelpContent from './QuadrilateralKeyboardHelpContent.js';

class MoveShapeHelpSection extends KeyboardHelpSection {
public constructor() {
Expand All @@ -34,7 +35,7 @@ class MoveShapeHelpSection extends KeyboardHelpSection {
} ) )
], {
labelOptions: {
lineWrap: 175
lineWrap: QuadrilateralKeyboardHelpContent.LABEL_LINE_WRAP
}
}
);
Expand Down
4 changes: 4 additions & 0 deletions js/quadrilateral/view/QuadrilateralKeyboardHelpContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import MoveShapeHelpSection from './MoveShapeHelpSection.js';
import ShapeShortcutsHelpSection from './ShapeShortcutsHelpSection.js';

class QuadrilateralKeyboardHelpContent extends TwoColumnKeyboardHelpContent {

// consistent line wrap for long text in sections of this content
public static readonly LABEL_LINE_WRAP = 175;

public constructor() {

// sim-specific help content about how to interact with the shape
Expand Down
3 changes: 2 additions & 1 deletion js/quadrilateral/view/ShapeShortcutsHelpSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import TextKeyNode from '../../../../scenery-phet/js/keyboard/TextKeyNode.js';
import { voicingManager } from '../../../../scenery/js/imports.js';
import quadrilateral from '../../quadrilateral.js';
import QuadrilateralStrings from '../../QuadrilateralStrings.js';
import QuadrilateralKeyboardHelpContent from './QuadrilateralKeyboardHelpContent.js';

// Voicing is NOT translatable and will never be
const checkShapeWithVoicingString = 'With Voicing enabled Check Current Shape';
Expand All @@ -27,7 +28,7 @@ class ShapeShortcutsHelpSection extends KeyboardHelpSection {
checkShapeWithVoicingString,
KeyboardHelpIconFactory.altPlusIcon( new LetterKeyNode( 'C' ) ), {
labelOptions: {
lineWrap: 175
lineWrap: QuadrilateralKeyboardHelpContent.LABEL_LINE_WRAP
}
}
);
Expand Down

0 comments on commit fe5a582

Please sign in to comment.