Skip to content

Commit

Permalink
apply checkbox style, move CONTROL_SCALE to panel content, #207
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Dec 31, 2019
1 parent 884f61f commit 84be694
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions js/gravity-force-lab/view/GravityForceLabControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ define( require => {
const constantSizeCheckboxTandem = options.tandem.createTandem( 'constantRadiusCheckbox' );
const constantSizeCheckbox = new Checkbox( new Text( constantSizeString,
ISLCCheckboxPanel.getCheckboxTextOptions( constantSizeCheckboxTandem ) ),
model.constantRadiusProperty, {
model.constantRadiusProperty, merge( {}, ISLCCheckboxPanel.CHECKBOX_OPTIONS, {
tandem: constantSizeCheckboxTandem,
accessibleName: constantSizeString,
descriptionContent: constantSizeCheckboxHelpTextString,
textSize: CHECKBOX_TEXT_SIZE
} );
} ) );

super( new VBox( {
children: [
Expand Down
4 changes: 0 additions & 4 deletions js/gravity-force-lab/view/GravityForceLabScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ define( require => {
const forceSound = require( 'sound!GRAVITY_FORCE_LAB/saturated-sine-loop-trimmed.wav' );

// constants
const CONTROL_SCALE = 0.72;
const SHOW_GRID = ISLCQueryParameters.showGrid;
const SHOW_RULER_REGIONS = ISLCQueryParameters.showRulerRegions;
const OBJECT_ONE = ISLCObjectEnum.OBJECT_ONE;
Expand Down Expand Up @@ -159,8 +158,6 @@ define( require => {
massDescriber,
tandem.createTandem( 'massControl1' )
);

massControl1.scale( CONTROL_SCALE );
massControlsNode.addChild( massControl1 );

const massControl2 = new MassControl(
Expand All @@ -174,7 +171,6 @@ define( require => {
massDescriber,
tandem.createTandem( 'massControl2' )
);
massControl2.scale( CONTROL_SCALE );
massControlsNode.addChild( massControl2 );

model.constantRadiusProperty.link( function( constantRadius ) {
Expand Down
6 changes: 4 additions & 2 deletions js/gravity-force-lab/view/MassControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define( require => {
const TRACK_SIZE = new Dimension2( 170, 3 );
const THUMB_SIZE = new Dimension2( 22, 42 );
const SliderDragState = Enumeration.byKeys( [ 'NOT_DRAGGING', 'DRAGGING_VIA_POINTER', 'DRAGGING_VIA_KEYBOARD' ] );
const CONTROL_SCALE = 0.72;

class MassControl extends ISLCObjectControlPanel {

Expand All @@ -49,10 +50,11 @@ define( require => {
super( titleString, unitsKgString, valueProperty, massRange, {
// panel options
fill: '#FDF498',
xMargin: 15,
yMargin: 10,
xMargin: 9,
yMargin: 9,

numberControlOptions: {
scale: CONTROL_SCALE, // scale down the control to fit the screen a bit better
sliderOptions: {
thumbSize: THUMB_SIZE,
trackSize: TRACK_SIZE,
Expand Down

0 comments on commit 84be694

Please sign in to comment.