Skip to content

Commit

Permalink
Preferences dialog now closes on CLOSE DIALOG key binding (JabRef#9268)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjb-ch1mp committed Oct 21, 2022
1 parent a217790 commit 76bd95b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where an exception was not logged correctly. [koppor#627](https://github.com/JabRef/koppor/issues/627)
- We fixed an issue where hitting enter on the search field within the preferences dialog closed the dialog. [koppor#630](https://github.com/koppor/jabref/issues/630)
- We fixed a typo within a connection error message. [koppor#625](https://github.com/koppor/jabref/issues/625)
- We fixed an issue where the 'close dialog' key binding was not closing the Preferences dialog. [#8888](https://github.com/jabref/jabref/issues/8888)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.jabref.gui.DialogService;
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.keyboard.KeyBinding;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.util.BaseDialog;
import org.jabref.gui.util.ControlHelper;
Expand Down Expand Up @@ -72,6 +73,13 @@ private void initialize() {

preferenceTabList.itemsProperty().setValue(viewModel.getPreferenceTabs());

// The list view does not respect the listener for the dialog and needs its own
preferenceTabList.setOnKeyReleased(key -> {
if (preferencesService.getKeyBindingRepository().checkKeyCombinationEquality(KeyBinding.CLOSE, key)) {
this.closeDialog();
}
});

PreferencesSearchHandler searchHandler = new PreferencesSearchHandler(viewModel.getPreferenceTabs());
preferenceTabList.itemsProperty().bindBidirectional(searchHandler.filteredPreferenceTabsProperty());
searchBox.textProperty().addListener((observable, previousText, newText) -> {
Expand Down

0 comments on commit 76bd95b

Please sign in to comment.