Skip to content

Commit

Permalink
address layout issues with long strings, see #176
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsamuel137 committed Nov 9, 2015
1 parent fa7ca84 commit 5ffdc07
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion js/gravity-and-orbits/view/BodyNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ define( function( require ) {
font: FONT,
listener: function() {
clock.setSimulationTime( 0 );
}
},
maxWidth: 200
} );

// update text representation of day
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5ffdc07

Please sign in to comment.