JAL-3416 make flatlaf default for linux improvement/JAL-3416_default_to_LIVE_DRAG_MODE_for_flatlaf
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 16 Nov 2022 11:23:00 +0000 (11:23 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 16 Nov 2022 11:23:00 +0000 (11:23 +0000)
src/jalview/bin/Jalview.java
src/jalview/gui/Desktop.java

index 9f37540..a241abe 100755 (executable)
@@ -998,7 +998,7 @@ public class Jalview
       setSystemLookAndFeel();
       if (Platform.isLinux())
       {
-        setMetalLookAndFeel();
+        setLinuxLookAndFeel();
       }
       if (Platform.isMac())
       {
@@ -1161,6 +1161,18 @@ public class Jalview
     return set;
   }
 
+  private static boolean setLinuxLookAndFeel()
+  {
+    boolean set = false;
+    set = setFlatLookAndFeel();
+    if (!set)
+      set = setMetalLookAndFeel();
+    // avoid GtkLookAndFeel -- not good results especially on HiDPI
+    if (!set)
+      set = setNimbusLookAndFeel();
+    return set;
+  }
+
   private static void showUsage()
   {
     System.out.println(
index 20532be..8ed4261 100644 (file)
@@ -193,6 +193,8 @@ public class Desktop extends jalview.jbgui.GDesktop
   {
     DRAG_MODE = b ? JDesktopPane.LIVE_DRAG_MODE
             : JDesktopPane.OUTLINE_DRAG_MODE;
+    if (desktop != null)
+      desktop.setDragMode(DRAG_MODE);
   }
 
   private JalviewChangeSupport changeSupport = new JalviewChangeSupport();