file change indication

This commit is contained in:
Radek Davidek 2026-01-21 10:24:11 +01:00
parent bc42c8986f
commit 4d9774471c

View File

@ -524,6 +524,7 @@ public class FilePanelTab extends JPanel {
lastValidRow = row; lastValidRow = row;
lastValidBriefColumn = briefCurrentColumn; lastValidBriefColumn = briefCurrentColumn;
} }
updateStatus();
} else { } else {
// Selection became empty. Attempt to restore it. // Selection became empty. Attempt to restore it.
// We do this even if e.getValueIsAdjusting() is true to prevent temporary selection loss. // We do this even if e.getValueIsAdjusting() is true to prevent temporary selection loss.
@ -543,6 +544,7 @@ public class FilePanelTab extends JPanel {
try { try {
fileTable.scrollRectToVisible(fileTable.getCellRect(finalRow, finalCol, true)); fileTable.scrollRectToVisible(fileTable.getCellRect(finalRow, finalCol, true));
} catch (Exception ignore) {} } catch (Exception ignore) {}
updateStatus();
} }
}); });
} }
@ -923,6 +925,7 @@ public class FilePanelTab extends JPanel {
if (requestFocus) { if (requestFocus) {
fileTable.requestFocusInWindow(); fileTable.requestFocusInWindow();
} }
updateStatus();
}); });
} else { } else {
if (autoSelectFirst && fileTable.getRowCount() > 0) { if (autoSelectFirst && fileTable.getRowCount() > 0) {
@ -946,9 +949,8 @@ public class FilePanelTab extends JPanel {
} }
}); });
} }
}
updateStatus(); updateStatus();
}
// Notify directory change // Notify directory change
if (onDirectoryChanged != null) { if (onDirectoryChanged != null) {
@ -1004,7 +1006,6 @@ public class FilePanelTab extends JPanel {
} }
} }
fileTable.repaint(); fileTable.repaint();
updateStatus();
}); });
} }
@ -2318,9 +2319,10 @@ public class FilePanelTab extends JPanel {
} }
} }
String newStatus;
if (markedCount > 0) { if (markedCount > 0) {
statusLabel.setText(String.format(" Selected: %d files, %d directories (%s)", newStatus = String.format(" Selected: %d files, %d directories (%s)",
fileCount, dirCount, FileItem.formatSize(totalSize))); fileCount, dirCount, FileItem.formatSize(totalSize));
} else { } else {
int selectedRow = fileTable.getSelectedRow(); int selectedRow = fileTable.getSelectedRow();
if (selectedRow >= 0) { if (selectedRow >= 0) {
@ -2334,22 +2336,26 @@ public class FilePanelTab extends JPanel {
if (item != null && !item.getName().equals("..")) { if (item != null && !item.getName().equals("..")) {
if (item.isDirectory()) { if (item.isDirectory()) {
// Always display directory names in square brackets // Always display directory names in square brackets
statusLabel.setText(String.format(" [%s] | %s", newStatus = String.format(" [%s] | %s",
item.getName(), item.getName(),
item.getFormattedDate())); item.getFormattedDate());
} else { } else {
statusLabel.setText(String.format(" %s | %s | %s", newStatus = String.format(" %s | %s | %s",
item.getName(), item.getName(),
FileItem.formatSize(item.getSize()), FileItem.formatSize(item.getSize()),
item.getFormattedDate())); item.getFormattedDate());
} }
} else { } else {
statusLabel.setText(String.format(" Items: %d", tableModel.items.size())); newStatus = String.format(" Items: %d", tableModel.items.size());
} }
} else { } else {
statusLabel.setText(String.format(" Items: %d", tableModel.items.size())); newStatus = String.format(" Items: %d", tableModel.items.size());
} }
} }
if (statusLabel != null && !newStatus.equals(statusLabel.getText())) {
statusLabel.setText(newStatus);
}
} }
/** /**