Skip to content

Commit

Permalink
set appearance of play and pause buttons to flat (see #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
veillette committed Aug 16, 2016
1 parent 5c5efd0 commit fa37ddb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions js/common/view/PauseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ define( function( require ) {
var PlinkoConstants = require( 'PLINKO_PROBABILITY/common/PlinkoConstants' );
var plinkoProbability = require( 'PLINKO_PROBABILITY/plinkoProbability' );
var Rectangle = require( 'SCENERY/nodes/Rectangle' );
var RoundButtonView = require( 'SUN/buttons/RoundButtonView' );
var RoundPushButton = require( 'SUN/buttons/RoundPushButton' );

// constants
Expand All @@ -31,7 +32,8 @@ define( function( require ) {

options = _.extend( {
radius: DEFAULT_RADIUS,
baseColor: PAUSE_BUTTON_BASE_COLOR
baseColor: PAUSE_BUTTON_BASE_COLOR,
buttonAppearanceStrategy: RoundButtonView.flatAppearanceStrategy
}, options );

// pause symbols are sized relative to the radius
Expand All @@ -41,9 +43,9 @@ define( function( require ) {
var bar = function() { return new Rectangle( 0, 0, barWidth, barHeight, { fill: 'black' } ); };
var bar1 = bar();
var bar2 = bar();
var pausePath = new HBox( { children: [ bar1, bar2 ], spacing: barWidth, pickable: false } );
var pausePath = new HBox( { children: [ bar1, bar2 ], spacing: barWidth, pickable: false} );

// put the pause symbols inside a circle
// layout
pausePath.centerX = 0;
pausePath.centerY = 0;

Expand Down
8 changes: 5 additions & 3 deletions js/common/view/PlayButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ define( function( require ) {
var Path = require( 'SCENERY/nodes/Path' );
var PlinkoConstants = require( 'PLINKO_PROBABILITY/common/PlinkoConstants' );
var plinkoProbability = require( 'PLINKO_PROBABILITY/plinkoProbability' );
var RoundButtonView = require( 'SUN/buttons/RoundButtonView' );
var RoundPushButton = require( 'SUN/buttons/RoundPushButton' );
var Shape = require( 'KITE/Shape' );

Expand All @@ -33,7 +34,8 @@ define( function( require ) {

options = _.extend( {
radius: DEFAULT_RADIUS,
baseColor: PLAY_BUTTON_BASE_COLOR
baseColor: PLAY_BUTTON_BASE_COLOR,
buttonAppearanceStrategy: RoundButtonView.flatAppearanceStrategy
}, options );

// play symbol is sized relative to the radius
Expand All @@ -42,9 +44,9 @@ define( function( require ) {

// create the Path of the triangle
var playPath = new Path( new Shape().moveTo( 0, triangleHeight / 2 ).lineTo( triangleWidth, 0 ).lineTo( 0, -triangleHeight / 2 ).close(),
{ fill: 'black', pickable:false } );
{ fill: 'black', pickable: false } );

// put the triangle within a circle
// layout
playPath.centerX = options.radius * 0.05; // move to right slightly since we don't want it exactly centered
playPath.centerY = 0;

Expand Down

0 comments on commit fa37ddb

Please sign in to comment.