From: Ben Soares Date: Wed, 14 Jun 2023 22:23:32 +0000 (+0100) Subject: JAL-4206 unified dimensions X-Git-Tag: Release_2_11_4_0~213^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=78daabcc6b478d861b3982754b8412e651cc8dc4;p=jalview.git JAL-4206 unified dimensions --- diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index ef7a2b8..fe01a69 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -51,6 +51,8 @@ import javax.swing.JScrollPane; import javax.swing.ListCellRenderer; import javax.swing.SpringLayout; import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.border.TitledBorder; import javax.swing.filechooser.FileFilter; import javax.swing.plaf.basic.BasicFileChooserUI; @@ -576,12 +578,6 @@ public class JalviewFileChooser extends JFileChooser list = new JList<>(recent); list.setCellRenderer(new recentlyOpenedCellRenderer()); - /* - DefaultListCellRenderer dlcr = new DefaultListCellRenderer(); - dlcr.setHorizontalAlignment(DefaultListCellRenderer.RIGHT); - list.setCellRenderer(dlcr); - */ - list.addMouseListener(new MouseAdapter() { @Override @@ -591,8 +587,11 @@ public class JalviewFileChooser extends JFileChooser } }); - this.setBorder(new javax.swing.border.TitledBorder( - MessageManager.getString("label.recently_opened"))); + TitledBorder recentlyOpenedBorder = new TitledBorder( + MessageManager.getString("label.recently_opened")); + recentlyOpenedBorder.setTitleFont( + recentlyOpenedBorder.getTitleFont().deriveFont(10f)); + this.setBorder(recentlyOpenedBorder); final JScrollPane scroller = new JScrollPane(list); @@ -602,20 +601,11 @@ public class JalviewFileChooser extends JFileChooser layout.putConstraint(SpringLayout.NORTH, scroller, 5, SpringLayout.NORTH, this); - // TODO are we now all using FlatLaf -- check same dimensions for - // everyone? - if (Platform.isAMacAndNotJS()) - { - scroller.setPreferredSize(new Dimension(280, 100)); - } - else - { - scroller.setPreferredSize(new Dimension(500, 200)); - } - + // one size okay for all + scroller.setPreferredSize(new Dimension(280, 105)); this.add(scroller); - javax.swing.SwingUtilities.invokeLater(new Runnable() + SwingUtilities.invokeLater(new Runnable() { @Override public void run()