From 1e1b70475bac10008bccb6946a442eebad4fc4c7 Mon Sep 17 00:00:00 2001 From: Artur Herdt Date: Tue, 6 Jun 2023 22:28:57 +0200 Subject: [PATCH 1/3] Move adding of css-class 'hits' to only if pref settings say to display group count, to remove empty grey boxes if said setting is turned off --- src/main/java/org/jabref/gui/groups/GroupTreeView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index cc298b32520..4778d81af05 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -266,7 +266,6 @@ private StackPane getArrowCell(GroupNodeViewModel viewModel) { private StackPane createNumberCell(GroupNodeViewModel group) { final StackPane node = new StackPane(); - node.getStyleClass().setAll("hits"); if (!group.isRoot()) { BindingsHelper.includePseudoClassWhen(node, PSEUDOCLASS_ANYSELECTED, group.anySelectedEntriesMatchedProperty()); @@ -281,7 +280,10 @@ private StackPane createNumberCell(GroupNodeViewModel group) { text.setText(""); } + node.getStyleClass().clear(); + if (newValue) { + node.getStyleClass().setAll("hits"); text.textProperty().bind(group.getHits().map(Number::intValue).map(this::getFormattedNumber)); } }); From a2a270fea2cf87bf2e5c4e15a03a08dd05035005 Mon Sep 17 00:00:00 2001 From: Artur Herdt Date: Tue, 6 Jun 2023 22:46:08 +0200 Subject: [PATCH 2/3] Refactor for easier if-structure and clearer naming --- src/main/java/org/jabref/gui/groups/GroupTreeView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 4778d81af05..96c33fb160b 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -274,7 +274,7 @@ private StackPane createNumberCell(GroupNodeViewModel group) { } Text text = new Text(); EasyBind.subscribe(preferencesService.getGroupsPreferences().displayGroupCountProperty(), - newValue -> { + shouldDisplayGroupCount -> { if (text.textProperty().isBound()) { text.textProperty().unbind(); text.setText(""); @@ -282,8 +282,8 @@ private StackPane createNumberCell(GroupNodeViewModel group) { node.getStyleClass().clear(); - if (newValue) { - node.getStyleClass().setAll("hits"); + if (shouldDisplayGroupCount) { + node.getStyleClass().add("hits"); text.textProperty().bind(group.getHits().map(Number::intValue).map(this::getFormattedNumber)); } }); From 12480c2b071701f14a9ddc417d7bf93d35af42ed Mon Sep 17 00:00:00 2001 From: Artur Herdt Date: Tue, 6 Jun 2023 22:54:28 +0200 Subject: [PATCH 3/3] Modify changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05e957b5bbc..1792dcd3ef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where passing a URL containing a DOI led to a "No entry found" notification. [#9821](https://github.com/JabRef/jabref/issues/9821) - We fixed some minor visual inconsistencies and issues in the preferences dialog. [#9866](https://github.com/JabRef/jabref/pull/9866) - The order of save actions is now retained. [#9890](https://github.com/JabRef/jabref/pull/9890) +- We fixed an issue where empty grey containers would remain in the groups panel, if displaying of group item count is turned off [#9972](https://github.com/JabRef/jabref/issues/9972) ### Removed