summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/gui/Gui.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/gui/Gui.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/gui/Gui.java')
-rw-r--r--src/main/java/cuchaz/enigma/gui/Gui.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/Gui.java b/src/main/java/cuchaz/enigma/gui/Gui.java
index a6e20a2..3593e4f 100644
--- a/src/main/java/cuchaz/enigma/gui/Gui.java
+++ b/src/main/java/cuchaz/enigma/gui/Gui.java
@@ -91,13 +91,13 @@ public class Gui {
91 } 91 }
92 92
93 public Gui() { 93 public Gui() {
94 Config.getInstance().lookAndFeel.setGlobalLAF();
95
94 // init frame 96 // init frame
95 this.frame = new JFrame(Constants.NAME); 97 this.frame = new JFrame(Constants.NAME);
96 final Container pane = this.frame.getContentPane(); 98 final Container pane = this.frame.getContentPane();
97 pane.setLayout(new BorderLayout()); 99 pane.setLayout(new BorderLayout());
98 100
99 Config.getInstance().lookAndFeel.setGlobalLAF();
100
101 if (Boolean.parseBoolean(System.getProperty("enigma.catchExceptions", "true"))) { 101 if (Boolean.parseBoolean(System.getProperty("enigma.catchExceptions", "true"))) {
102 // install a global exception handler to the event thread 102 // install a global exception handler to the event thread
103 CrashDialog.init(this.frame); 103 CrashDialog.init(this.frame);