Fix options menu overflowing screen boundaries#9807
Open
majochem wants to merge 6 commits intoPathOfBuildingCommunity:devfrom
Open
Fix options menu overflowing screen boundaries#9807majochem wants to merge 6 commits intoPathOfBuildingCommunity:devfrom
majochem wants to merge 6 commits intoPathOfBuildingCommunity:devfrom
Conversation
Currently the options menu disappears off the top and bottom of the screen without possibility to scroll. This is particularly annoying, if the option for UI size scaling is one of the hidden options. It now uses a two-column layout if there is enough horizontal space, but not enough vertical space.
Previously added 2 column layout, but if that doesn't fit, a scrollbar will be shown instead. I kept the 2 column layout as first fallback because it shows all available option on screen at once.
Because changing UI scale values causes the popup to re-open, it would previously overwrite the "initial" values. So changing a setting and then pressing "Cancel" would not actually discard the changes, but save them instead. The `savedState` can now be passed to `OpenOptionsPopup()` in order to have the initial values persist and be restored upon cancellation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9104
Fixes #9673
(maybe fixes some others too?, but those I could find)
Description of the problem being solved:
The options menu in
mainhas hard-coded dimensions that can overflow the screen and make certain options invisible. This is particularly problematic if you accidentally changed and saved "UI scaling" to a higher value, which you can then no longer see.This PR introduces two fallback behaviors:
Note: I have purposely kept the two-column layout as the first fallback, because I think, if possible, all available options should be visible at the same time, rather than hiding some behind scrolling
Steps taken to verify a working solution:
Limitations:
Link to a build that showcases this PR:
N/A
Before screenshot:
Overflow 150% scaling on 1920x1080

Overflow at 175% scaling on 1920x1080

After screenshot:
Two-column layout at 150% on 1920x1080

Scrollbar layout at 175% on 1920x1080

stuttering is just because low fps gif