diff --git a/src/main/java/cz/kamma/kfmanager/ui/MainWindow.java b/src/main/java/cz/kamma/kfmanager/ui/MainWindow.java index da6abb2..8e3d9c3 100644 --- a/src/main/java/cz/kamma/kfmanager/ui/MainWindow.java +++ b/src/main/java/cz/kamma/kfmanager/ui/MainWindow.java @@ -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); } /**