phetsims / equality-explorer

"Equality Explorer" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 3 forks source link

Use scenery layout to implement fixed-width panels. #207

Open pixelzoom opened 4 months ago

pixelzoom commented 4 months ago

Related to problems encountered in https://github.com/phetsims/natural-selection/issues/363 with old-style implementation of fixed-width panels...

Convert this sim's implementation of fixed-width panels to new-style scenery layout. To identify related code, start by searching for options fixedWidth, fixedHeight, contentWidth, and contentHeight.

Here's the general approach to fixed width panels that @jonathanolson recommended previously for gas-properties. For example in IdealScreenView.ts:

const PANEL_WIDTH = 225;
...
    const vBox = new VBox( {
      children: panels,
...
      // All panels have the same fixed width.
      stretch: true,
      minContentWidth: PANEL_WIDTH,
      maxWidth: PANEL_WIDTH
    } );