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

Flatlaf UI scaling #1610

Merged
merged 9 commits into from
Sep 15, 2024
Merged

Flatlaf UI scaling #1610

merged 9 commits into from
Sep 15, 2024

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Sep 12, 2024

This PR

  • adds GUI scaling to MML. It uses FlatLaf scaling rather than the manual scaling of MM, so the scaling itself is just a single System.setProperty call
  • removes all hardcoded sizes of elements as those interfere with scaling; these are replaced with "prototype" values/components that fix the size in a scale-friendly way
  • adds a setting to the options dialog. This works with MM's GUIPreferences gui scale setting rather than MML's own settings as I assume that separate gui scale values will not work for a combined install anyway so might a well use a single value
  • fixes a minor thing or two, e.g. the selected theme was not correctly checked in the menu upon startup

MML at a rather silly scale relative to the taskbar:
image

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 2.15%. Comparing base (04e239e) to head (5785bc8).
Report is 19 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##             master   #1610      +/-   ##
===========================================
+ Coverage      2.13%   2.15%   +0.01%     
- Complexity      204     205       +1     
===========================================
  Files           266     266              
  Lines         30697   30623      -74     
  Branches       5231    5234       +3     
===========================================
+ Hits            656     660       +4     
+ Misses        29888   29810      -78     
  Partials        153     153              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# Conflicts:
#	megameklab/src/megameklab/MegaMekLab.java
#	megameklab/src/megameklab/ui/battleArmor/BACriticalView.java
#	megameklab/src/megameklab/ui/dialog/settings/MiscSettingsPanel.java
#	megameklab/src/megameklab/ui/generalUnit/BasicInfoView.java
#	megameklab/src/megameklab/ui/generalUnit/summary/SummaryView.java
#	megameklab/src/megameklab/ui/mek/BMChassisView.java
#	megameklab/src/megameklab/ui/protoMek/PMCriticalView.java
#	megameklab/src/megameklab/ui/util/BayWeaponCriticalTree.java
#	megameklab/src/megameklab/ui/util/CritListCellRenderer.java
#	megameklab/src/megameklab/ui/util/CriticalTransferHandler.java
#	megameklab/src/megameklab/ui/util/ProtoMekMountList.java
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.

I tested this pre-Mek merge and it was working great.

@SJuliez SJuliez merged commit 9778e0e into MegaMek:master Sep 15, 2024
5 checks passed
@SJuliez SJuliez deleted the flatlaf-ui-scaling branch October 15, 2024 19:35
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.

2 participants