diff options
| author | 2021-03-16 21:20:35 +0200 | |
|---|---|---|
| committer | 2021-03-16 21:20:35 +0200 | |
| commit | 2bee1fe38b37fa1812f4cbb7c2766a09f61dd486 (patch) | |
| tree | 404f42bbcedf3a7d54dc6e09fa152588f7fb8feb | |
| parent | Rerun CI (diff) | |
| download | enigma-2bee1fe38b37fa1812f4cbb7c2766a09f61dd486.tar.gz enigma-2bee1fe38b37fa1812f4cbb7c2766a09f61dd486.tar.xz enigma-2bee1fe38b37fa1812f4cbb7c2766a09f61dd486.zip | |
Disable FlatLaf's custom HiDPI scaling
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/config/LookAndFeel.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/config/LookAndFeel.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/config/LookAndFeel.java index d1d3e0df..47614676 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/config/LookAndFeel.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/config/LookAndFeel.java | |||
| @@ -10,6 +10,7 @@ import javax.swing.plaf.metal.MetalLookAndFeel; | |||
| 10 | 10 | ||
| 11 | import com.formdev.flatlaf.FlatDarculaLaf; | 11 | import com.formdev.flatlaf.FlatDarculaLaf; |
| 12 | import com.formdev.flatlaf.FlatLightLaf; | 12 | import com.formdev.flatlaf.FlatLightLaf; |
| 13 | import com.formdev.flatlaf.FlatSystemProperties; | ||
| 13 | 14 | ||
| 14 | public enum LookAndFeel { | 15 | public enum LookAndFeel { |
| 15 | DEFAULT("Default"), | 16 | DEFAULT("Default"), |
| @@ -31,6 +32,9 @@ public enum LookAndFeel { | |||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | public void setGlobalLAF() { | 34 | public void setGlobalLAF() { |
| 35 | // Disable FlatLaf's UI scaling, we do it on our own | ||
| 36 | System.setProperty(FlatSystemProperties.UI_SCALE_ENABLED, "false"); | ||
| 37 | |||
| 34 | try { | 38 | try { |
| 35 | switch (this) { | 39 | switch (this) { |
| 36 | case NONE: | 40 | case NONE: |