From: Ben Soares Date: Sun, 24 Jul 2022 16:37:59 +0000 (+0100) Subject: JAL-4034 add round corners to 3DB confirmation button with icon on a mac X-Git-Tag: Release_2_11_2_6~35^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=282aa9129a74235dc8d6c22b123d51eb1abd2f55;p=jalview.git JAL-4034 add round corners to 3DB confirmation button with icon on a mac --- diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 08cfa03..0c5af95 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -74,6 +74,7 @@ import jalview.gui.Desktop; import jalview.gui.JvSwingUtils; import jalview.gui.StructureViewer; import jalview.util.MessageManager; +import jalview.util.Platform; import net.miginfocom.swing.MigLayout; @SuppressWarnings("serial") @@ -595,8 +596,18 @@ public abstract class GStructureChooser extends JPanel }); chk_invertFilter.addItemListener(this); - btn_queryTDB = new JButton( - MessageManager.getString("label.search_3dbeacons")); + btn_queryTDB = new JButton(); + if (Platform.isMac()) + { + // needed to make icon button have round corners in vaqua + btn_queryTDB.putClientProperty("JButton.buttonType","bevel"); + btn_queryTDB.setMargin(new Insets(0, 16, 0, 20)); + } + else + { + btn_queryTDB.setMargin(new Insets(2, 16, 2, 20)); + } + btn_queryTDB.setText(MessageManager.getString("label.search_3dbeacons")); btn_queryTDB.setIconTextGap(12); btn_queryTDB.setIcon(tdbImage); btn_queryTDB.setVerticalTextPosition(SwingConstants.CENTER); @@ -604,7 +615,6 @@ public abstract class GStructureChooser extends JPanel btn_queryTDB.setFont(VERDANA_12); btn_queryTDB.setToolTipText( MessageManager.getString("label.find_models_from_3dbeacons")); - btn_queryTDB.setMargin(new Insets(2, 16, 2, 20)); // btn_queryTDB.setPreferredSize(new Dimension(200, 32)); btn_queryTDB.setVisible(false); @@ -958,4 +968,4 @@ public abstract class GStructureChooser extends JPanel { return mainFrame; } -} \ No newline at end of file +}