Skip to content

Fix options menu overflowing screen boundaries#9807

Open
majochem wants to merge 6 commits intoPathOfBuildingCommunity:devfrom
majochem:bug/ui/optionsMenuScaling
Open

Fix options menu overflowing screen boundaries#9807
majochem wants to merge 6 commits intoPathOfBuildingCommunity:devfrom
majochem:bug/ui/optionsMenuScaling

Conversation

@majochem
Copy link
Copy Markdown
Contributor

@majochem majochem commented Apr 22, 2026

Fixes #9104
Fixes #9673
(maybe fixes some others too?, but those I could find)

Description of the problem being solved:

The options menu in main has 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:

  1. If screen height is too low to render the full options menu, but wide enough to render two columns, it will render a two-column layout instead
  2. If the screen is not wide enough for the two-column layout, it will introduce a scrollbar instead which allows vertical scrolling.

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:

  • I tested this on my own monitors (one 3440x1440 and two 1920x1080) at various UI scaling options (both OS and PoB internal scaling), as well as individually resized windows and encountered only one issue (see "Limitations")
  • Having said that, I haven't done a lot of UI PRs, so there might be some niche edge cases that I overlooked

Limitations:

  • If you resize the PoB application window while the options menu is open, the popup does not automatically resize. This is technically solvable, but somewhat complicated and seems like an easy enough issue for the user to fix themselves (resize to original size -> close menu -> resize as much as you want -> re-open menu)

Link to a build that showcases this PR:

N/A

Before screenshot:

Overflow 150% scaling on 1920x1080
image

Overflow at 175% scaling on 1920x1080
image

After screenshot:

Two-column layout at 150% on 1920x1080
image

Scrollbar layout at 175% on 1920x1080
20260422-1459-21 9429609

stuttering is just because low fps gif

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.
@majochem majochem marked this pull request as ready for review April 22, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the "Options" menu at low resolution, not all options are visible UI scaling issue

1 participant