From 5ffdc07d72d0cd7127bb6a1d9d3cdba9b5df996b Mon Sep 17 00:00:00 2001 From: aaronsamuel137 Date: Mon, 9 Nov 2015 15:31:03 -0700 Subject: [PATCH] address layout issues with long strings, see #176 --- js/gravity-and-orbits/view/BodyNode.js | 3 ++- .../view/bottom-control-panel/DayCounter.js | 3 ++- .../view/bottom-control-panel/SpeedRadioButtons.js | 12 ++++++++---- .../view/right-control-panel/BodyMassControl.js | 3 ++- .../view/right-control-panel/GravityModeMenu.js | 2 +- .../view/right-control-panel/MassControlPanel.js | 3 ++- .../SpaceObjectsPropertyCheckbox.js | 3 ++- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/js/gravity-and-orbits/view/BodyNode.js b/js/gravity-and-orbits/view/BodyNode.js index 34d38511..afce28f1 100644 --- a/js/gravity-and-orbits/view/BodyNode.js +++ b/js/gravity-and-orbits/view/BodyNode.js @@ -98,7 +98,8 @@ define( function( require ) { font: new PhetFont( 18 ), x: tail.x - this.width / 2 - 5, y: tail.y - this.height - 10, - fill: GravityAndOrbitsColorProfile.bodyNodeTextProperty + fill: GravityAndOrbitsColorProfile.bodyNodeTextProperty, + maxWidth: 75 } ); node.addChild( text ); diff --git a/js/gravity-and-orbits/view/bottom-control-panel/DayCounter.js b/js/gravity-and-orbits/view/bottom-control-panel/DayCounter.js index d3b68a30..cac5b687 100644 --- a/js/gravity-and-orbits/view/bottom-control-panel/DayCounter.js +++ b/js/gravity-and-orbits/view/bottom-control-panel/DayCounter.js @@ -47,7 +47,8 @@ define( function( require ) { font: FONT, listener: function() { clock.setSimulationTime( 0 ); - } + }, + maxWidth: 200 } ); // update text representation of day diff --git a/js/gravity-and-orbits/view/bottom-control-panel/SpeedRadioButtons.js b/js/gravity-and-orbits/view/bottom-control-panel/SpeedRadioButtons.js index 8216898e..cc02c26b 100644 --- a/js/gravity-and-orbits/view/bottom-control-panel/SpeedRadioButtons.js +++ b/js/gravity-and-orbits/view/bottom-control-panel/SpeedRadioButtons.js @@ -39,10 +39,14 @@ define( function( require ) { radius: 8 }, options ); - var textOption = { font: new PhetFont( 18 ), fill: GravityAndOrbitsColorProfile.bottomControlTextProperty }; - var fastText = new Text( fastForwardString, textOption ); - var normalText = new Text( normalString, textOption ); - var slowText = new Text( slowMotionString, textOption ); + var textOptions = { + font: new PhetFont( 18 ), + fill: GravityAndOrbitsColorProfile.bottomControlTextProperty, + maxWidth: 200 + }; + var fastText = new Text( fastForwardString, textOptions ); + var normalText = new Text( normalString, textOptions ); + var slowText = new Text( slowMotionString, textOptions ); VerticalAquaRadioButtonGroup.call( this, [ { property: speedProperty, value: STARTING_VALUE * 1.75, node: fastText }, diff --git a/js/gravity-and-orbits/view/right-control-panel/BodyMassControl.js b/js/gravity-and-orbits/view/right-control-panel/BodyMassControl.js index 4a8bc0a1..86809611 100644 --- a/js/gravity-and-orbits/view/right-control-panel/BodyMassControl.js +++ b/js/gravity-and-orbits/view/right-control-panel/BodyMassControl.js @@ -43,7 +43,8 @@ define( function( require ) { top: 10, centerX: SPACING, font: new PhetFont( 11 ), - fill: GravityAndOrbitsColorProfile.panelTextProperty + fill: GravityAndOrbitsColorProfile.panelTextProperty, + maxWidth: 110 } ); var ticks = []; diff --git a/js/gravity-and-orbits/view/right-control-panel/GravityModeMenu.js b/js/gravity-and-orbits/view/right-control-panel/GravityModeMenu.js index 864e9981..fd1e828d 100644 --- a/js/gravity-and-orbits/view/right-control-panel/GravityModeMenu.js +++ b/js/gravity-and-orbits/view/right-control-panel/GravityModeMenu.js @@ -25,7 +25,7 @@ define( function( require ) { // constants var FONT = new PhetFont( 14 ); - var TEXT_OPTIONS = { font: FONT, fill: GravityAndOrbitsColorProfile.panelTextProperty }; + var TEXT_OPTIONS = { font: FONT, fill: GravityAndOrbitsColorProfile.panelTextProperty, maxWidth: 50 }; var RADIO_OPTIONS = { radius: 7 }; /** diff --git a/js/gravity-and-orbits/view/right-control-panel/MassControlPanel.js b/js/gravity-and-orbits/view/right-control-panel/MassControlPanel.js index 7ee1e5af..2ba9ed34 100644 --- a/js/gravity-and-orbits/view/right-control-panel/MassControlPanel.js +++ b/js/gravity-and-orbits/view/right-control-panel/MassControlPanel.js @@ -39,7 +39,8 @@ define( function( require ) { var label = new Text( massSettableBody.name, { font: CONTROL_FONT, fontWeight: 'bold', - fill: GravityAndOrbitsColorProfile.panelTextProperty + fill: GravityAndOrbitsColorProfile.panelTextProperty, + maxWidth: 175 } ); var icon = massSettableBody.createRenderer( 14 ); diff --git a/js/gravity-and-orbits/view/right-control-panel/SpaceObjectsPropertyCheckbox.js b/js/gravity-and-orbits/view/right-control-panel/SpaceObjectsPropertyCheckbox.js index 94b3459d..afaacf01 100644 --- a/js/gravity-and-orbits/view/right-control-panel/SpaceObjectsPropertyCheckbox.js +++ b/js/gravity-and-orbits/view/right-control-panel/SpaceObjectsPropertyCheckbox.js @@ -45,7 +45,8 @@ define( function( require ) { var CHECKBOX_OPTIONS = { scale: 0.8, checkBoxColor: GravityAndOrbitsColorProfile.panelTextProperty, - checkBoxColorBackground: GravityAndOrbitsColorProfile.checkBoxFillProperty + checkBoxColorBackground: GravityAndOrbitsColorProfile.checkBoxFillProperty, + maxWidth: 250 }; var TEXT_OPTIONS = { font: FONT, fill: GravityAndOrbitsColorProfile.panelTextProperty }; var SPACING = 10;