Skip to content

Commit

Permalink
Remove not so useful button
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Schnick committed Jan 16, 2021
1 parent 2b6adef commit 9ab0f9c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ public class SavegameManagerState {

public class Filter {
private StringProperty filter = new SimpleStringProperty("");
private BooleanProperty deepSearch = new SimpleBooleanProperty(false);

private Filter() {
filter.addListener((c,o,n) -> {
SavegameManagerState.this.updateShownCollections();
});
deepSearch.addListener((c,o,n) -> {
SavegameManagerState.this.updateShownCollections();
});
}

public String getFilter() {
Expand All @@ -37,20 +33,12 @@ public StringProperty filterProperty() {
return filter;
}

public boolean isDeepSearch() {
return deepSearch.get();
}

public BooleanProperty deepSearchProperty() {
return deepSearch;
}

public boolean shouldShow(SavegameCollection<?,?> col) {
if (col.getName().toLowerCase().contains(filter.get().toLowerCase())) {
return true;
}

return deepSearch.get() && col.getSavegames().stream()
return col.getSavegames().stream()
.anyMatch(e -> e.getName().toLowerCase().contains(filter.get().toLowerCase()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ private static Region createTopBar() {
});
filter.textProperty().bindBidirectional(SavegameManagerState.get().getFilter().filterProperty());
box.getChildren().add(filter);

ToggleButton deepSearch = new ToggleButton();
deepSearch.getStyleClass().add(GuiStyle.CLASS_RECURSIVE);
deepSearch.setGraphic(new FontIcon());
deepSearch.selectedProperty().bindBidirectional(SavegameManagerState.get().getFilter().deepSearchProperty());
GuiTooltips.install(deepSearch, "Include individual savegame names in search");
box.getChildren().add(deepSearch);
return box;
}
}

0 comments on commit 9ab0f9c

Please sign in to comment.