MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
134 stars 171 forks source link

Darcula Flat UI Scaling Broken #4412

Open Algebro7 opened 4 months ago

Algebro7 commented 4 months ago

Environment

0.49.20 Linux (KDE Plasma DE) OpenJDK Runtime Environment (build 17.0.11+9)

Description

UI Scaling for the Darcula Flat theme is broken on my 3440x1440 monitor. Global scaling is set to the default 100% and other apps scale correctly, but elements in MekHQ Darcula are scaled way too big, making text unreadable in a number of instances. MekHQ Metal theme scales correctly.

Example in Darcula:

darcula

Same screen in Metal:

metal

Algebro7 commented 2 months ago

I did some more digging into this today and turns out this is being caused by FlatLAF's built in HiDPI scaling. As a workaround for now I can patch the MekHQ launcher script to add -Dflatlaf.uiScale=1 to the java command, but as a more long term solution I will probably make it configurable in the MekHQ options. I did some testing and confirmed you can switch it at runtime.