From b043daf3a2eb0ef3fa65e1849a6eb3ba2acb149b Mon Sep 17 00:00:00 2001 From: zepumph Date: Thu, 26 Oct 2017 13:06:05 -0800 Subject: [PATCH] add titleLeftIndent option to NumberControl.createLayoutFunction3, https://github.com/phetsims/rutherford-scattering/issues/128 --- js/NumberControl.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/NumberControl.js b/js/NumberControl.js index 15eb3a657..af46ac30d 100644 --- a/js/NumberControl.js +++ b/js/NumberControl.js @@ -10,6 +10,7 @@ define( function( require ) { 'use strict'; // modules + var AlignBox = require( 'SCENERY/nodes/AlignBox' ); var ArrowButton = require( 'SUN/buttons/ArrowButton' ); var Color = require( 'SCENERY/util/Color' ); var Dimension2 = require( 'DOT/Dimension2' ); @@ -428,6 +429,7 @@ define( function( require ) { options = _.extend( { alignTitle: 'center', // {string} horizontal alignment of title, relative to slider, 'left'|'right'|'center' alignNumber: 'center', // {string} horizontal alignment of number display, relative to slider, 'left'|'right'|'center' + titleLeftIndent: 0, // {number|null} if provided, add an HStrut on the left of the title to push the title to the right xSpacing: 5, // {number} horizontal spacing between arrow buttons and slider ySpacing: 5 // {number} vertical spacing between rows }, options ); @@ -438,7 +440,7 @@ define( function( require ) { resize: false, // prevent slider from causing a resize when thumb is at min or max align: options.alignTitle, children: [ - titleNode, + new AlignBox( titleNode, { leftMargin: options.titleLeftIndent } ), new VBox( { spacing: options.ySpacing, resize: false, // prevent slider from causing a resize when thumb is at min or max