Skip to content

Commit

Permalink
Prevent group expansion arrow from activating group when expanding or…
Browse files Browse the repository at this point in the history
… collapsing (#8785)

* Prevent group expansion arrow from activating group when expanding or collapsing

* Update solution by picking StackPane that has either arrow or tree-node-disclosure styleclass

* Check secondary mousebutton, then only check if is StackPane class

* Pattern matching to remove unnecessary StackPane cast

* Update equal() to contains() as object could have multiple styles

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
LIM0000 authored May 22, 2022
1 parent 264357c commit a355534
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- Writing BibTeX data into a PDF (XMP) does not write the `file` field.
- Writing BibTeX data into a PDF (XMP) considers the configured keyword separator (and does not use "," as default any more)
- The Medline/Pubmed search now also supports the [default fields and operators for searching](https://docs.jabref.org/collect/import-using-online-bibliographic-database#search-syntax). [forum#3554](https://discourse.jabref.org/t/native-pubmed-search/3354)
- We improved group expansion arrow that prevent it from activating group when expanding or collapsing. [#7982](https://github.com/JabRef/jabref/issues/7982), [#3176](https://github.com/JabRef/jabref/issues/3176)

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ private void initialize() {
if (event.getButton() == MouseButton.SECONDARY) {
// Prevent right-click to select group
event.consume();
} else if (event.getTarget() instanceof StackPane pane) {
if (pane.getStyleClass().contains("arrow") || pane.getStyleClass().contains("tree-disclosure-node")) {
event.consume();
}
}
});

Expand Down

0 comments on commit a355534

Please sign in to comment.