Fix display of "nothing found" label in thumb overviews

This commit is contained in:
0xb00bface 2021-03-27 18:46:13 +01:00
parent f57f36de05
commit 0e014f8d8d
1 changed files with 24 additions and 24 deletions

View File

@ -383,11 +383,6 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
// move models, which are tracked by the recorder to the front
moveActiveRecordingsToFront();
// show "empty" label, if grid is still empty
if (grid.getChildren().isEmpty()) {
nodes.add(noResultsFound);
}
} finally {
gridLock.unlock();
}
@ -795,9 +790,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
insert(thumbCell);
}
filteredThumbCells.clear();
return;
}
} else {
// remove the ones from grid, which don't match
for (Iterator<Node> iterator = grid.getChildren().iterator(); iterator.hasNext();) {
Node node = iterator.next();
@ -823,6 +816,13 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
}
}
if (grid.getChildren().size() > 1 && grid.getChildren().contains(noResultsFound)) {
grid.getChildren().remove(noResultsFound);
} else if (grid.getChildren().isEmpty()) {
grid.getChildren().add(noResultsFound);
}
}
private void moveActiveRecordingsToFront() {
List<ThumbCell> thumbsToMove = new ArrayList<>();
ObservableList<Node> thumbs = grid.getChildren();