Skip to content

Commit

Permalink
add example of a button with different corner radii, #454
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jan 18, 2019
1 parent 03d9593 commit e410006
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions js/demo/ButtonsScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ define( function( require ) {
baseColor: 'rgb( 204, 102, 204 )'
} );

// Test for a button with different radii for each corner
var radiiTestButton = new RectangularPushButton( {
baseColor: 'orange',
minWidth: 50,
minHeight: 50,
leftTopCornerRadius: 20,
rightTopCornerRadius: 10,
rightBottomCornerRadius: 5,
leftBottomCornerRadius: 0
} );

var buttonD = new RoundPushButton( {
content: new Text( '--- D ---', { font: BUTTON_FONT } ),
listener: function() { message( 'Button D pressed' ); },
Expand All @@ -166,12 +177,11 @@ define( function( require ) {
} );

var pseudo3DButtonsBox = new HBox( {
children: [ buttonA, buttonB, buttonC, buttonD, buttonE ],
children: [ buttonA, buttonB, buttonC, radiiTestButton, buttonD, buttonE ],
spacing: 10,
left: radioButtonPanel.right + 25,
top: this.layoutBounds.top + 15
} );

this.addChild( pseudo3DButtonsBox );

//===================================================================================
Expand Down

0 comments on commit e410006

Please sign in to comment.