-
Notifications
You must be signed in to change notification settings - Fork 6
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
Limit width of content in KeyboardHelpDialog #546
Comments
This issue is not specific to KeyboardHelpDialog but all Dialogs. Dialogs don't have knowledge of the dev bounds and are often not attached to a ScreenView so it doesn't seem like a Dialog can do this generally. |
What if we have a supertype KeyboardHelpDialogContent that has a default maxWidth that works well for default layout bounds of ScreenView but can be specified as an option for sims that are not using default layout bounds? |
I found phet.sim.joist.screenBoundsProperty (joist-internal) (read-only). What if we just used a percent of that? |
@jessegreenberg please review. Do you think that this kind of solution could work? |
Thanks @zepumph, something like this could work. Dialog has a Only a single instance of KeyboardHelpDialog is created so the maxWidth will change depending on whether the dialog is opened on the home screen vs a sim screen. Instead of setting on construction maybe we can update the maxWidth on show. |
Ah, I found that Dialog has a layoutStrategy option that has everything that we need! |
…he simulation bounds, see #546
I tested this in RIAW, friction, and coulombs-law. @zepumph can you please review? |
This looks awesome! Well done. I will note in friction, and let you handle RIAW. |
KeyboardHelpDialog currently assumes that its content will keep the width within the dev bounds. But this means that we generally need to define a max width on the content every time we create a KeyboardHelpDialog. In phetsims/resistance-in-a-wire#203 @jbphet recommended
Assigning to myself to investigate.
The text was updated successfully, but these errors were encountered: