JAL-3608 Enforcing MetalLookAndFeel as default on linux. Can be overridden with laf...
authorBen Soares <bsoares@dundee.ac.uk>
Thu, 30 Apr 2020 19:41:09 +0000 (20:41 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Thu, 30 Apr 2020 19:41:09 +0000 (20:41 +0100)
src/jalview/bin/Jalview.java
src/jalview/util/Platform.java

index 87e26ee..cc3a4a2 100755 (executable)
@@ -415,6 +415,9 @@ public class Jalview
     if (!lafSet)
     {
       setSystemLookAndFeel();
+      if (Platform.isLinux() && ! Platform.isJS()) {
+        setMetalLookAndFeel();
+      }
       if (Platform.isAMacAndNotJS())
       {
         setMacLookAndFeel();
index d6627c4..71d798d 100644 (file)
@@ -52,7 +52,7 @@ public class Platform
           false;
 
   private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null,
-          isWin = null;
+          isWin = null, isLinux = null;
 
   private static Boolean isHeadless = null;
 
@@ -81,6 +81,18 @@ public class Platform
   }
 
   /**
+   * added to check LaF for Linux
+   * 
+   * @return
+   */
+  public static boolean isLinux()
+  {
+    return (isLinux == null
+            ? (isLinux = (System.getProperty("os.name").indexOf("Linux") >= 0))
+            : isLinux);
+  }
+
+  /**
    * 
    * @return true if HTML5 JavaScript
    */