Skip to content

Commit

Permalink
update max width for all KeyboardHelpDialogs (HelpContent); remove ve…
Browse files Browse the repository at this point in the history
…rticalIconSpacing, HelpContent.labelWithIcon.labelFirst; see #158
  • Loading branch information
zepumph committed Jan 26, 2019
1 parent 8ff05ee commit de3f991
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions js/friction/view/FrictionKeyboardHelpContentPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,27 @@ define( function( require ) {

// constants
const DEFAULT_LABEL_OPTIONS = {
font: HelpContent.DEFAULT_LABEL_FONT,
maxWidth: HelpContent.DEFAULT_TEXT_MAX_WIDTH,
lineWrap: HelpContent.DEFAULT_TEXT_MAX_WIDTH
font: HelpContent.DEFAULT_LABEL_FONT
};

/**
* @constructor
*/
function FrictionKeyboardHelpContentPanel() {

const grabReleaseHelpContent = HelpContent.getGrabReleaseHelpContent( bookTitleString, bookLabelString );
const moveBookHelpContent = new MoveBookHelpNode();
const generalNavigationHelpContent = new GeneralNavigationHelpContent();
// make all the HelpContents consistent in layout
const maxWidth = 130;
const grabReleaseHelpContent = HelpContent.getGrabReleaseHelpContent( bookTitleString, bookLabelString, {
baseLabelMaxWidth: maxWidth
} );
const moveBookHelpContent = new MoveBookHelpContent( {
baseLabelMaxWidth: maxWidth

} );
const generalNavigationHelpContent = new GeneralNavigationHelpContent( {
baseLabelMaxWidth: maxWidth

} );

HelpContent.alignHelpContentIcons( [ grabReleaseHelpContent, moveBookHelpContent ] );

Expand All @@ -68,15 +76,13 @@ define( function( require ) {
* @param {Object} [options]
* @constructor
*/
function MoveBookHelpNode( options ) {
function MoveBookHelpContent( options ) {

Node.call( this );
options = _.extend( {

// icon options
arrowKeysScale: 0.55,
verticalIconSpacing: HelpContent.DEFAULT_VERTICAL_ICON_SPACING

arrowKeysScale: 0.55
}, options );

// BookNode row
Expand All @@ -93,7 +99,7 @@ define( function( require ) {
HelpContent.call( this, moveBookHeaderString, [ moveBookRow, row ], options );
}

inherit( HelpContent, MoveBookHelpNode );
inherit( HelpContent, MoveBookHelpContent );

friction.register( 'FrictionKeyboardHelpContentPanel', FrictionKeyboardHelpContentPanel );

Expand Down

0 comments on commit de3f991

Please sign in to comment.