Skip to content

Commit c02efb0

Browse files
[Fix]Pre-Downloader UX changes
1 parent 4fdae60 commit c02efb0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

mode/src/processing/mode/android/SDKDownloader.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,13 @@ private void createInitLayout(SDKUrlHolder downloadUrls) {
720720
downloadPathPanel.setLayout(new BorderLayout());
721721
JLabel pathLabel = new JLabel("Installation Path: ");
722722
downloadPathPanel.add(pathLabel,BorderLayout.NORTH);
723+
723724
final JLabel locationLabel = new JLabel(processing.app.Base.getSketchbookFolder().getAbsolutePath());
725+
locationLabel.setMaximumSize(Toolkit.zoom(100,locationLabel.getHeight()));
726+
locationLabel.setPreferredSize(Toolkit.zoom(100,locationLabel.getHeight()));
727+
locationLabel.setToolTipText(locationLabel.getText());
724728
downloadPathPanel.add(locationLabel,BorderLayout.WEST);
729+
725730
JButton selectPathButton = new JButton("Change");
726731
Dimension dim = new Dimension(Toolkit.getButtonWidth(),
727732
Toolkit.zoom(selectPathButton.getPreferredSize().height));
@@ -735,13 +740,20 @@ public void actionPerformed(ActionEvent e) {
735740
fd.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
736741
fd.setVisible(true);
737742
System.setProperty("apple.awt.fileDialogForDirectories", "false");
743+
if(fd.getFile() != null){
744+
locationLabel.setText(new File(fd.getDirectory(),fd.getFile()).getAbsolutePath());
745+
locationLabel.setToolTipText(locationLabel.getText());
746+
}
738747
} else {
739748
JFileChooser fc = new JFileChooser();
740749
fc.setDialogTitle("Select Download Location");
741750
fc.setCurrentDirectory(processing.app.Base.getSketchbookFolder());
742751
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
743752
fc.showOpenDialog(SDKDownloader.super.rootPane); //To put it on top of the modalDialog
744-
if (fc.getSelectedFile() != null) locationLabel.setText(fc.getSelectedFile().getAbsolutePath());
753+
if (fc.getSelectedFile() != null) {
754+
locationLabel.setText(fc.getSelectedFile().getAbsolutePath());
755+
locationLabel.setToolTipText(locationLabel.getText());
756+
}
745757
}
746758
}
747759
});

0 commit comments

Comments
 (0)