Skip to content

Commit

Permalink
Select the first tab which matches the search query in preferences (#…
Browse files Browse the repository at this point in the history
…4825)

window

After every search clear the selection of tabs and select the first
tab in the tabsList.

Fixes #4824
  • Loading branch information
CaptainDaVinci authored and tobiasdiez committed Mar 30, 2019
1 parent 91d779a commit 40600b3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ private void construct() {
ScrollPane preferencePaneContainer = new ScrollPane(tab.getBuilder());
preferencePaneContainer.getStyleClass().add("preferencePaneContainer");
container.setCenter(preferencePaneContainer);
} else {
container.setCenter(null);
}
});
tabsList.getSelectionModel().selectFirst();
Expand All @@ -136,6 +138,8 @@ private void construct() {
tabsList.itemsProperty().bindBidirectional(searchHandler.filteredPreferenceTabsProperty());
searchBox.textProperty().addListener((observable, previousText, newText) -> {
searchHandler.filterTabs(newText.toLowerCase(Locale.ROOT));
tabsList.getSelectionModel().clearSelection();
tabsList.getSelectionModel().selectFirst();
});

VBox buttonContainer = new VBox();
Expand Down

0 comments on commit 40600b3

Please sign in to comment.