fix: "Validate" button disappears after app font-size change #1255
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 #1244, where in the "Validate" button sometimes disappears. Per discussion in the bug, when a
JFileChooser
is shown on some platforms, it causes the apps default font size to increase. This ultimately causes the app's layout to grow vertically, which can push the validate button off the bottom of the window.While we don't know the root cause of the font change, we can address the symptom. Namely, we introduce a
pack()
call after any use of theJFileChooser
, which will cause the app to resize to match the preferred size of its content. Most of the time, there will be no change, but if the font size has increased, the app will resize appropriately. We already use a similar approach when showing and hiding the advanced app settings.To make the re-pack slightly less jarring, we also specify a fixed column count for the text input fields, such that the app does not dynamically resize in response to strings of different lengths. Finally, we set a minimum size of the app based on initial content size to keep the app from shrinking beyond that preferred minimum.
gradle test
to make sure you didn't break anything