From: Ben Soares Date: Wed, 16 Nov 2022 11:23:00 +0000 (+0000) Subject: JAL-3416 make flatlaf default for linux X-Git-Tag: Release_2_11_3_0~23^2~4^2~9^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7f0c5c453a345a700b9e19caebaf7a3b55783759;p=jalview.git JAL-3416 make flatlaf default for linux --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 9f37540..a241abe 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -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( diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 20532be..8ed4261 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -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();