diff --git a/src/main/java/cz/kamma/kfmanager/ui/FilePanelTab.java b/src/main/java/cz/kamma/kfmanager/ui/FilePanelTab.java index 8ba63b9..1c13ec6 100644 --- a/src/main/java/cz/kamma/kfmanager/ui/FilePanelTab.java +++ b/src/main/java/cz/kamma/kfmanager/ui/FilePanelTab.java @@ -966,6 +966,18 @@ public class FilePanelTab extends JPanel { public void refresh(boolean requestFocus) { List newItems = createFileItemList(currentDirectory); if (isSameContent(newItems, tableModel.items)) { + // Nothing changed since last refresh. If there were any "recently changed" + // highlights, clear them now as the files have stabilized. + boolean found = false; + for (FileItem item : tableModel.items) { + if (item.isRecentlyChanged()) { + item.setRecentlyChanged(false); + found = true; + } + } + if (found) { + fileTable.repaint(); + } return; } @@ -1025,24 +1037,6 @@ public class FilePanelTab extends JPanel { } } fileTable.repaint(); - - if (!changedNames.isEmpty()) { - // Clear the recentlyChanged flag after 2 seconds - javax.swing.Timer timer = new javax.swing.Timer(2000, e -> { - boolean found = false; - for (FileItem item : tableModel.items) { - if (item.isRecentlyChanged()) { - item.setRecentlyChanged(false); - found = true; - } - } - if (found) { - fileTable.repaint(); - } - }); - timer.setRepeats(false); - timer.start(); - } }); }