Skip to content

Commit

Permalink
pdomOrder for Diffusion screen, #213
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Mar 18, 2024
1 parent dd554d7 commit 7f400d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 8 additions & 4 deletions js/common/view/BaseScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import ScreenView, { ScreenViewOptions } from '../../../../joist/js/ScreenView.js';
import optionize from '../../../../phet-core/js/optionize.js';
import { Node } from '../../../../scenery/js/imports.js';
import ResetAllButton from '../../../../scenery-phet/js/buttons/ResetAllButton.js';
import TimeControlNode from '../../../../scenery-phet/js/TimeControlNode.js';
import Tandem from '../../../../tandem/js/Tandem.js';
Expand All @@ -26,8 +27,11 @@ export default abstract class BaseScreenView extends ScreenView {

protected readonly model: BaseModel;

// subclass is responsible for position
protected readonly timeControlNode: TimeControlNode;
// subclass is responsible for position and pdomOrder
protected readonly timeControlNode: Node;

// subclass is responsible for pdomOrder
protected readonly resetAllButton: Node;

protected constructor( model: BaseModel, tandem: Tandem, providedOptions?: BaseScreenViewOptions ) {

Expand Down Expand Up @@ -78,13 +82,13 @@ export default abstract class BaseScreenView extends ScreenView {
this.addChild( this.timeControlNode );

// Reset All button
const resetAllButton = new ResetAllButton( {
this.resetAllButton = new ResetAllButton( {
listener: () => { this.reset(); },
right: this.layoutBounds.maxX - GasPropertiesConstants.SCREEN_VIEW_X_MARGIN,
bottom: this.layoutBounds.maxY - GasPropertiesConstants.SCREEN_VIEW_Y_MARGIN,
tandem: tandem.createTandem( 'resetAllButton' )
} );
this.addChild( resetAllButton );
this.addChild( this.resetAllButton );
}

protected reset(): void {
Expand Down
12 changes: 12 additions & 0 deletions js/diffusion/view/DiffusionScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ export default class DiffusionScreenView extends BaseScreenView {
this.addChild( particleFlowRateNode2 );
this.addChild( stopwatchNode );

this.pdomPlayAreaNode.pdomOrder = [
//TODO https://github.com/phetsims/gas-properties/issues/213
];

this.pdomControlAreaNode.pdomOrder = [
//TODO https://github.com/phetsims/gas-properties/issues/213
dataAccordionBox,
controlPanel,
this.timeControlNode,
this.resetAllButton
];

// Position the time controls
this.timeControlNode.mutate( {
left: controlPanel.left,
Expand Down

0 comments on commit 7f400d3

Please sign in to comment.