summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/config/Themes.java
diff options
context:
space:
mode:
authorGravatar Bartosz Skrzypczak2019-02-07 10:05:10 +0100
committerGravatar Adrian Siekierka2019-02-07 10:05:10 +0100
commit96c796d4d385b7a076a3e7ab7b374907472487e2 (patch)
tree9828a6af02e103ec293f9ceed60e7527a9d271f6 /src/main/java/cuchaz/enigma/config/Themes.java
parentFix entry remapping not applying to resolved entry (diff)
downloadenigma-fork-96c796d4d385b7a076a3e7ab7b374907472487e2.tar.gz
enigma-fork-96c796d4d385b7a076a3e7ab7b374907472487e2.tar.xz
enigma-fork-96c796d4d385b7a076a3e7ab7b374907472487e2.zip
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.
Diffstat (limited to 'src/main/java/cuchaz/enigma/config/Themes.java')
-rw-r--r--src/main/java/cuchaz/enigma/config/Themes.java2
1 files changed, 1 insertions, 1 deletions
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 {
19 19
20 public static void updateTheme(Gui gui) { 20 public static void updateTheme(Gui gui) {
21 Config config = Config.getInstance(); 21 Config config = Config.getInstance();
22 config.lookAndFeel.apply(config);
23 config.lookAndFeel.setGlobalLAF(); 22 config.lookAndFeel.setGlobalLAF();
23 config.lookAndFeel.apply(config);
24 try { 24 try {
25 config.saveConfig(); 25 config.saveConfig();
26 } catch (IOException e) { 26 } catch (IOException e) {