diff --git a/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java b/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java index db2dfa29..3e335286 100644 --- a/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java +++ b/client/src/main/java/ctbrec/ui/tabs/ThumbOverviewTab.java @@ -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,31 +790,36 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener { insert(thumbCell); } filteredThumbCells.clear(); - return; - } + } else { + // remove the ones from grid, which don't match + for (Iterator iterator = grid.getChildren().iterator(); iterator.hasNext();) { + Node node = iterator.next(); + if (node instanceof ThumbCell) { + ThumbCell cell = (ThumbCell) node; + Model m = cell.getModel(); + if (!matches(m, filter)) { + iterator.remove(); + filteredThumbCells.add(cell); + cell.setSelected(false); + } + } + } - // remove the ones from grid, which don't match - for (Iterator iterator = grid.getChildren().iterator(); iterator.hasNext();) { - Node node = iterator.next(); - if (node instanceof ThumbCell) { - ThumbCell cell = (ThumbCell) node; - Model m = cell.getModel(); - if (!matches(m, filter)) { + // add the ones, which might have been filtered before, but now match + for (Iterator iterator = filteredThumbCells.iterator(); iterator.hasNext();) { + ThumbCell thumbCell = iterator.next(); + Model m = thumbCell.getModel(); + if(matches(m, filter)) { iterator.remove(); - filteredThumbCells.add(cell); - cell.setSelected(false); + insert(thumbCell); } } } - // add the ones, which might have been filtered before, but now match - for (Iterator iterator = filteredThumbCells.iterator(); iterator.hasNext();) { - ThumbCell thumbCell = iterator.next(); - Model m = thumbCell.getModel(); - if(matches(m, filter)) { - iterator.remove(); - insert(thumbCell); - } + if (grid.getChildren().size() > 1 && grid.getChildren().contains(noResultsFound)) { + grid.getChildren().remove(noResultsFound); + } else if (grid.getChildren().isEmpty()) { + grid.getChildren().add(noResultsFound); } }