From 96c796d4d385b7a076a3e7ab7b374907472487e2 Mon Sep 17 00:00:00 2001 From: Bartosz Skrzypczak Date: Thu, 7 Feb 2019 10:05:10 +0100 Subject: Add System and None (JVM Default) themes. (#107) The current 2 editor color schemes are used depending on whether a LAF is detected to be dark ot light. This is done by drawing an empty JPanel into a dummy image and getting the grayscale pixel brightness. Move setting theme a bit earlier so it doesn't throw exceptions in some cases when using system theme. Change the order of setting swing LAF and applying theme so that apply() can get the right colors.--- src/main/java/cuchaz/enigma/config/Themes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/cuchaz/enigma/config/Themes.java') diff --git a/src/main/java/cuchaz/enigma/config/Themes.java b/src/main/java/cuchaz/enigma/config/Themes.java index 400ea3f..753654e 100644 --- a/src/main/java/cuchaz/enigma/config/Themes.java +++ b/src/main/java/cuchaz/enigma/config/Themes.java @@ -19,8 +19,8 @@ public class Themes { public static void updateTheme(Gui gui) { Config config = Config.getInstance(); - config.lookAndFeel.apply(config); config.lookAndFeel.setGlobalLAF(); + config.lookAndFeel.apply(config); try { config.saveConfig(); } catch (IOException e) { -- cgit v1.2.3