Skip to content

Commit

Permalink
Recreating a ButtonGroup behavior in studio, see #28
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinVallejo committed Sep 27, 2024
1 parent 8cb5da4 commit 3110ae3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/coins/view/InitialCoinStateSelectorNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Property from '../../../../axon/js/Property.js';
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js';
import { combineOptions } from '../../../../phet-core/js/optionize.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import { Color, HBox, Text, VBox } from '../../../../scenery/js/imports.js';
import { Color, GatedVisibleProperty, HBox, Text, VBox } from '../../../../scenery/js/imports.js';
import RectangularRadioButton, { RectangularRadioButtonOptions } from '../../../../sun/js/buttons/RectangularRadioButton.js';
import Panel from '../../../../sun/js/Panel.js';
import Tandem from '../../../../tandem/js/Tandem.js';
Expand All @@ -33,7 +33,7 @@ export default class InitialCoinStateSelectorNode extends VBox {

public readonly orientationIndicatorCoinNode: CoinNode;

public constructor( initialCoinStateProperty: TReadOnlyProperty<ClassicalCoinStates> | TReadOnlyProperty<QuantumUncollapsedCoinStates>,
public constructor( initialCoinStateProperty: Property<ClassicalCoinStates> | Property<QuantumUncollapsedCoinStates>,
upProbabilityProperty: TReadOnlyProperty<number>,
preparingExperimentProperty: TReadOnlyProperty<boolean>,
systemType: SystemType,
Expand Down Expand Up @@ -110,10 +110,12 @@ export default class InitialCoinStateSelectorNode extends VBox {
stroke: null,
yMargin: 10,
minWidth: 270,
visibleProperty: preparingExperimentProperty, // TODO: Gated visible prop, see https://github.com/phetsims/quantum-measurement/issues/28
visibleProperty: new GatedVisibleProperty( preparingExperimentProperty, radioButtonGroupTandem ),
tandem: radioButtonGroupTandem
} );

selectorPanel.addLinkedElement( initialCoinStateProperty );

// Add the Node that will indicate the initial orientation of the coin.
let orientationIndicatorCoinNode;
if ( systemType === 'classical' ) {
Expand Down

0 comments on commit 3110ae3

Please sign in to comment.