From: Ben Soares Date: Tue, 1 Nov 2022 18:29:09 +0000 (+0000) Subject: JAL-3416 set flatlaf default drag mode to LIVE_DRAG_MODE X-Git-Tag: Release_2_11_3_0~23^2~4^2~9^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7bb1887834cefc1a39ffd5b034b77c7984a13009;p=jalview.git JAL-3416 set flatlaf default drag mode to LIVE_DRAG_MODE --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 1428906..9f37540 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -1123,6 +1123,8 @@ public class Jalview UIManager.put("TabbedPane.tabWidthMode", "compact"); UIManager.put("TabbedPane.selectedBackground", Color.white); } + + Desktop.setLiveDragMode(Cache.getDefault("FLAT_LIVE_DRAG_MODE", true)); return set; } diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 16603df..20532be 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -187,6 +187,14 @@ public class Desktop extends jalview.jbgui.GDesktop public static HashMap savingFiles = new HashMap(); + private static int DRAG_MODE = JDesktopPane.OUTLINE_DRAG_MODE; + + public static void setLiveDragMode(boolean b) + { + DRAG_MODE = b ? JDesktopPane.LIVE_DRAG_MODE + : JDesktopPane.OUTLINE_DRAG_MODE; + } + private JalviewChangeSupport changeSupport = new JalviewChangeSupport(); public static boolean nosplash = false; @@ -482,7 +490,7 @@ public class Desktop extends jalview.jbgui.GDesktop } getContentPane().add(desktop, BorderLayout.CENTER); - desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); + desktop.setDragMode(DRAG_MODE); // This line prevents Windows Look&Feel resizing all new windows to maximum // if previous window was maximised