Skip to content
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

Replace Manual GUI scaling with FlatLaf Scaling #6068

Merged
merged 6 commits into from
Oct 5, 2024

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Oct 5, 2024

This PR removes most of the code of the old manual GUI scaling and replaces it with Flatlaf's built in scaling. It leaves some of the HTML-related methods in UIUtil and just "de-arms" and renames them as the tooltips make heavy use of them and I think we should rewrite those with CSS anyway. This PR also adds a util class for adding font and style to swing components using flatlaf's clientproperty style. The advantage of this is that it is less hassle than using setFont() and scales effortlessly.

If anyone reviews this, better turn off whitespace changes. It's still a lot.

Merge together with MHQ #4989

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@SJuliez
Copy link
Member Author

SJuliez commented Oct 5, 2024

CodeQL warnings are because I marked the old html methods as deprecated. No real problem

Copy link
Member

@HammerGS HammerGS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I didn't open every menu or screen, the scalilng works well.

@HammerGS HammerGS merged commit dbc041b into MegaMek:master Oct 5, 2024
4 checks passed
@SJuliez SJuliez mentioned this pull request Oct 7, 2024
@SJuliez SJuliez deleted the replace-gui-scaling branch October 15, 2024 19:31
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.

3 participants