From a4246b6166b45ac79c87c42d2a56bc7f95205a62 Mon Sep 17 00:00:00 2001 From: Juuxel Date: Mon, 15 Mar 2021 13:36:34 +0200 Subject: Migrate to FlatLaf Fixes #355. - Replaces the Darcula look and feel with FlatLaf Darcula, which does not have the same rendering bugs with CJK characters (at least on Windows 10). - Replaces Metal with FlatLaf Light as the default look and feel. Metal is provided as a new, separate theme option. --- .../src/main/java/cuchaz/enigma/gui/config/LookAndFeel.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'enigma-swing/src/main/java') 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 1c70d439..d1d3e0df 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 @@ -8,16 +8,18 @@ import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.plaf.metal.MetalLookAndFeel; -import com.bulenkov.darcula.DarculaLaf; +import com.formdev.flatlaf.FlatDarculaLaf; +import com.formdev.flatlaf.FlatLightLaf; public enum LookAndFeel { DEFAULT("Default"), DARCULA("Darcula"), + METAL("Metal"), SYSTEM("System"), NONE("None (JVM default)"); // the "JVM default" look and feel, get it at the beginning and store it so we can set it later - private static javax.swing.LookAndFeel NONE_LAF = UIManager.getLookAndFeel(); + private static final javax.swing.LookAndFeel NONE_LAF = UIManager.getLookAndFeel(); private final String name; LookAndFeel(String name) { @@ -35,10 +37,13 @@ public enum LookAndFeel { UIManager.setLookAndFeel(NONE_LAF); break; case DEFAULT: + UIManager.setLookAndFeel(new FlatLightLaf()); + break; + case METAL: UIManager.setLookAndFeel(new MetalLookAndFeel()); break; case DARCULA: - UIManager.setLookAndFeel(new DarculaLaf()); + UIManager.setLookAndFeel(new FlatDarculaLaf()); break; case SYSTEM: UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); -- cgit v1.2.3