Skip to content

Commit

Permalink
Merge pull request #8105 from mbien/dir-chooiser-pixel-adjustments
Browse files Browse the repository at this point in the history
DirectoryChooserUI button position adjustments
  • Loading branch information
mbien authored Jan 2, 2025
2 parents 62f8dbf + 34e2eef commit 33cdacf
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@
public class DirectoryChooserUI extends BasicFileChooserUI {
private static final String DIALOG_IS_CLOSING = "JFileChooserDialogIsClosingProperty";

private static final Dimension horizontalStrut1 = new Dimension(25, 1);
private static final Dimension horizontalStrut1 = new Dimension(10, 1);
private static final Dimension verticalStrut1 = new Dimension(1, 4);
private static final Dimension verticalStrut2 = new Dimension(1, 6);
private static final Dimension verticalStrut3 = new Dimension(1, 8);
private static Dimension PREF_SIZE = new Dimension(425, 245);
private static Dimension MIN_SIZE = new Dimension(425, 245);
Expand Down Expand Up @@ -476,9 +475,9 @@ public Dimension getMaximumSize() {
}
approveButton.addActionListener(getApproveSelectionAction());
approveButton.setToolTipText(getApproveButtonToolTipText(fc));
buttonPanel.add(Box.createRigidArea(verticalStrut1));
buttonPanel.add(Box.createRigidArea(verticalStrut3));
buttonPanel.add(approveButton);
buttonPanel.add(Box.createRigidArea(verticalStrut2));
buttonPanel.add(Box.createRigidArea(verticalStrut3));

cancelButton = new JButton(cancelButtonText) {
@Override
Expand Down Expand Up @@ -650,7 +649,6 @@ private JComponent createTopToolbar() {
}

topPanel.add(upFolderButton);
topPanel.add(Box.createRigidArea(new Dimension(2, 0)));

// no home on Win platform
if (!Utilities.isWindows()) {
Expand Down Expand Up @@ -710,11 +708,10 @@ private JComponent createTopToolbar() {
}

topPanel.add(newFolderButton);
topPanel.add(Box.createRigidArea(new Dimension(2, 0)));

JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(4, 9, 8, 0));
panel.setBorder(BorderFactory.createEmptyBorder(2, 9, 8, 0));
panel.add(topPanel, BorderLayout.CENTER);

return panel;
Expand Down

0 comments on commit 33cdacf

Please sign in to comment.