command line label improved
This commit is contained in:
parent
04ad8605eb
commit
c373b1aa18
@ -292,9 +292,10 @@ public class MainWindow extends JFrame {
|
||||
JPanel cmdPanel = new JPanel(new BorderLayout(5, 0));
|
||||
cmdPanel.setBorder(BorderFactory.createEmptyBorder(2, 5, 0, 5));
|
||||
|
||||
cmdLabel = new JLabel(System.getProperty("user.name") + ":" + (activePanel != null ? activePanel.getCurrentDirectory().getAbsolutePath() : "") + ">");
|
||||
cmdLabel = new JLabel();
|
||||
cmdLabel.setFont(new Font("Monospaced", Font.BOLD, 12));
|
||||
cmdPanel.add(cmdLabel, BorderLayout.WEST);
|
||||
updateCommandLinePrompt();
|
||||
|
||||
commandLine = new JComboBox<>();
|
||||
commandLine.setEditable(true);
|
||||
@ -1389,12 +1390,17 @@ public class MainWindow extends JFrame {
|
||||
|
||||
private void updateCommandLinePrompt() {
|
||||
if (cmdLabel == null) return;
|
||||
|
||||
|
||||
FilePanel active = activePanel;
|
||||
if (active == null) return;
|
||||
|
||||
|
||||
String path = active.getCurrentPath();
|
||||
cmdLabel.setText(path + ">");
|
||||
String displayPath = path;
|
||||
if (path.length() > 33) {
|
||||
displayPath = path.substring(0, 15) + "..." + path.substring(path.length() - 15);
|
||||
}
|
||||
cmdLabel.setText(displayPath + ">");
|
||||
cmdLabel.setToolTipText(path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user