phetsims / molecule-shapes

"Molecule Shapes" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molecule-shapes
GNU General Public License v3.0
5 stars 6 forks source link

Panel width should expand if panel title is long #224

Closed arouinfar closed 1 year ago

arouinfar commented 2 years ago

Related to #223

When making the panel titles long, they seem to escape the maxWidth of the panel. I had to widen the sim window to pull these strings within view. They originally escaped the window bounds. image

Affected strings: strings.moleculeShapes.control.bondingStringProperty strings.moleculeShapes.control.lonePairStringProperty strings.moleculeShapes.control.optionsStringProperty strings.moleculeShapes.control.moleculeStringProperty

It seems like the string maxWidth is based on the associated panel maxWidth, but that width is only realized if the panel contents expand. image

@jonathanolson it seems like the panel should expand when the title is long, not just when the contents are long.

I'll open a side issue for the ComboBox button which is oddly stretched -- see #224

arouinfar commented 2 years ago

Tagging for https://github.com/phetsims/qa/issues/844 and https://github.com/phetsims/qa/issues/845.

KatieWoe commented 2 years ago

I noticed that this can cause the text to go out of bounds before it starts shrinking.

samreid commented 1 year ago

@arouinfar or @KatieWoe is this still a problem? I tried expanding the Bonding title and saw that it resized the panel:

image

Longer strings seemed to shrink at the appropriate point.

image

Please close if all is well, or specify more about how I can test and observe this.

KatieWoe commented 1 year ago

I still see this on master, and strings seem to also go out of bounds to the right.

stillmaster
samreid commented 1 year ago

I likely missed this since I was editing the _en translation file--so perhaps the startup string length behaves different than changing it at runtime. I'll re-self-assign.

jonathanolson commented 1 year ago

Handled in the above commit, closing!