From 18847928ef3b5873fc576ac3438fda4d536cd4ac Mon Sep 17 00:00:00 2001 From: jbphet Date: Thu, 21 Jul 2022 11:14:40 -0600 Subject: [PATCH] made button appearance options into sub-options for better typing, see https://github.com/phetsims/chipper/issues/1253, https://github.com/phetsims/sun/issues/754, and https://github.com/phetsims/sun/issues/772 --- js/common/view/DisturbanceTypeRadioButtonGroup.js | 10 ++++++---- js/common/view/SceneRadioButtonGroup.js | 6 ++++-- js/diffraction/view/DiffractionScreenView.js | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/js/common/view/DisturbanceTypeRadioButtonGroup.js b/js/common/view/DisturbanceTypeRadioButtonGroup.js index 62c1264d..2ac5a952 100644 --- a/js/common/view/DisturbanceTypeRadioButtonGroup.js +++ b/js/common/view/DisturbanceTypeRadioButtonGroup.js @@ -28,12 +28,14 @@ class DisturbanceTypeRadioButtonGroup extends RectangularRadioButtonGroup { } ], merge( { orientation: 'vertical', radioButtonOptions: { + baseColor: 'white', xMargin: 1, yMargin: 8, - selectedLineWidth: 2, - baseColor: 'white', - selectedStroke: 'blue', - deselectedContentOpacity: 0.4 + buttonAppearanceStrategyOptions: { + selectedLineWidth: 2, + selectedStroke: 'blue', + deselectedContentOpacity: 0.4 + } } }, options ) ); } diff --git a/js/common/view/SceneRadioButtonGroup.js b/js/common/view/SceneRadioButtonGroup.js index ce9f91a8..41832105 100644 --- a/js/common/view/SceneRadioButtonGroup.js +++ b/js/common/view/SceneRadioButtonGroup.js @@ -30,9 +30,11 @@ class SceneRadioButtonGroup extends RectangularRadioButtonGroup { orientation: 'horizontal', spacing: 15, radioButtonOptions: { - selectedStroke: '#73bce1', baseColor: 'white', - selectedLineWidth: 2 + buttonAppearanceStrategyOptions: { + selectedStroke: '#73bce1', + selectedLineWidth: 2 + } } } ); } diff --git a/js/diffraction/view/DiffractionScreenView.js b/js/diffraction/view/DiffractionScreenView.js index f6541668..cf522807 100644 --- a/js/diffraction/view/DiffractionScreenView.js +++ b/js/diffraction/view/DiffractionScreenView.js @@ -143,8 +143,10 @@ class DiffractionScreenView extends ScreenView { const sceneRadioButtonGroup = new RectangularRadioButtonGroup( model.sceneProperty, sceneRadioButtonContent, { radioButtonOptions: { baseColor: 'white', - selectedStroke: '#419ac9', - selectedLineWidth: 2 + buttonAppearanceStrategyOptions: { + selectedStroke: '#419ac9', + selectedLineWidth: 2 + } }, right: this.apertureNode.left - 20, bottom: this.apertureNode.bottom