-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HSlider doesn't play well with panels that expand for i18n #378
Comments
A generalization of this behavior extends to Panels whose content has default sizes that are larger than the Panel. This behavior was also present in the VerticalCheckboxGroup above the gravity slider. The current solution involves making the Panel larger so the content fits its default size. There is room for discussion on a general solution. |
I don't understand what the problem is here. Developers can set (and should be setting) independent |
Considering the above comments from @pixelzoom and further discussion with @jonathanolson, I should not be using maxWidths to size texts or nodes. Instead, they should be sized using font, scale, etc. and then a maxWidth should be applied. There isn't anything that needs to be added to common code but instead, this revised approach should be taken in the future to negate the need to refactor sim code. |
A common strategy for i18n is to allow panels to expand by some amount before scaling down the contents/strings within.
Masses and Springs contains a panel with some pretty long strings, so I requested this behavior, which ended up leading to a bit of refactoring, and ultimately required that the default panel width itself be wider, as @Denz1994 explained in phetsims/masses-and-springs#308 (comment):
Other relevant MAS i18n issues include:
phetsims/masses-and-springs#293
phetsims/masses-and-springs#313
I found this pretty surprising, given that there are many other expanding panels containing HSlider or numberControl (examples below), and that the panel widths in MAS rc.2 weren't particularly small. In the case of MAS, I was okay with making the default widths a bit wider, but there are likely other sims where I wouldn't want to make the default widths larger because it would be too visually heavy or crowded.
I was hoping that the devs could look into this and see if there is a more general solution than giving panels with HSlider a larger default width, so @ariel-phet recommended I open this issue.
Bending Light
Rutherford Scattering
CCK:DC
Here's a comparison of MAS rc.2 (original panel widths) and rc.3 (larger default panel widths):
@ariel-phet I know you had talked about this with @Denz1994, so can you add a bit onto this issue? I'm not sure if I've adequately described things for the devs. Also not sure if the title is appropriate or not.
The text was updated successfully, but these errors were encountered: