fixed background refresh blinking
This commit is contained in:
parent
7143c36ca3
commit
bc42c8986f
@ -875,16 +875,24 @@ public class FilePanelTab extends JPanel {
|
||||
}
|
||||
|
||||
public void loadDirectory(File directory, boolean autoSelectFirst, boolean requestFocus) {
|
||||
loadDirectory(directory, autoSelectFirst, requestFocus, null);
|
||||
}
|
||||
|
||||
public void loadDirectory(File directory, boolean autoSelectFirst, boolean requestFocus, final Runnable postLoadAction) {
|
||||
// If we are switching directories, cleanup any previously extracted archive temp dirs
|
||||
cleanupArchiveTempDirIfNeeded(directory);
|
||||
if (directory == null || !directory.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean directoryChanged = this.currentDirectory == null || !this.currentDirectory.equals(directory);
|
||||
this.currentDirectory = directory;
|
||||
|
||||
if (directoryChanged) {
|
||||
briefCurrentColumn = 0;
|
||||
lastValidRow = 0;
|
||||
lastValidBriefColumn = 0;
|
||||
}
|
||||
|
||||
List<FileItem> items = createFileItemList(directory);
|
||||
tableModel.setItems(items);
|
||||
@ -907,6 +915,11 @@ public class FilePanelTab extends JPanel {
|
||||
fileTable.setRowSelectionInterval(selRow, selRow);
|
||||
fileTable.scrollRectToVisible(fileTable.getCellRect(selRow, selCol, true));
|
||||
}
|
||||
|
||||
if (postLoadAction != null) {
|
||||
postLoadAction.run();
|
||||
}
|
||||
|
||||
if (requestFocus) {
|
||||
fileTable.requestFocusInWindow();
|
||||
}
|
||||
@ -920,6 +933,11 @@ public class FilePanelTab extends JPanel {
|
||||
fileTable.scrollRectToVisible(fileTable.getCellRect(0, 0, true));
|
||||
});
|
||||
}
|
||||
|
||||
if (postLoadAction != null) {
|
||||
postLoadAction.run();
|
||||
}
|
||||
|
||||
if (requestFocus) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
try {
|
||||
@ -957,9 +975,7 @@ public class FilePanelTab extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
loadDirectory(currentDirectory, false, requestFocus);
|
||||
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
loadDirectory(currentDirectory, false, requestFocus, () -> {
|
||||
// Restore marks
|
||||
for (FileItem item : tableModel.items) {
|
||||
if (markedNames.contains(item.getName())) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user