Skip to content

Commit

Permalink
Fix for unnecessary horizontal scroll bar in group panel (#8756)
Browse files Browse the repository at this point in the history
* Fix scrollbar shows up needlessly in group panel

* Update CHANGELOG.md

* Change solution to fix unneccesary scrollbar in group panel

* Remove first solution from GroupTree.css
  • Loading branch information
LIM0000 committed May 12, 2022
1 parent 177d5ec commit 6b9b84e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Fixed

- We fixed the unnecessary horizontal scroll bar in group panel [#8467](https://github.com/JabRef/jabref/issues/8467)
- We fixed an issue where the notification bar message, icon and actions appeared to be invisible. [#8761](https://github.com/JabRef/jabref/issues/8761)

### Removed
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,28 @@ private void createNodes() {

mainColumn = new TreeTableColumn<>();
mainColumn.setId("mainColumn");
mainColumn.setResizable(true);
numberColumn = new TreeTableColumn<>();
numberColumn.getStyleClass().add("numberColumn");
numberColumn.setMinWidth(50d);
numberColumn.setMaxWidth(70d);
numberColumn.setPrefWidth(60d);
numberColumn.setMinWidth(40d);
numberColumn.setMaxWidth(40d);
numberColumn.setPrefWidth(40d);
numberColumn.setResizable(false);
expansionNodeColumn = new TreeTableColumn<>();
expansionNodeColumn.getStyleClass().add("expansionNodeColumn");
expansionNodeColumn.setMaxWidth(25d);
expansionNodeColumn.setMinWidth(25d);
expansionNodeColumn.setMaxWidth(20d);
expansionNodeColumn.setMinWidth(20d);
expansionNodeColumn.setPrefWidth(20d);
expansionNodeColumn.setResizable(false);

groupTree = new TreeTableView<>();
groupTree.setId("groupTree");
groupTree.setColumnResizePolicy(TreeTableView.CONSTRAINED_RESIZE_POLICY);
groupTree.getColumns().addAll(List.of(mainColumn, numberColumn, expansionNodeColumn));
this.setCenter(groupTree);

mainColumn.prefWidthProperty().bind(groupTree.widthProperty().subtract(60d).subtract(15));

addNewGroup = new Button(Localization.lang("Add group"));
addNewGroup.setId("addNewGroup");
addNewGroup.setMaxWidth(Double.MAX_VALUE);
Expand Down

0 comments on commit 6b9b84e

Please sign in to comment.