Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 6175 #6424

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where citation styles except the default "Preview" could not be used. [#56220](https://github.com/JabRef/jabref/issues/5622)
- We fixed an issue where a warning was displayed when the title content is made up of two sentences. [#5832](https://github.com/JabRef/jabref/issues/5832)
- We fixed an issue where an exception was thrown when adding a save action without a selected formatter in the library properties [#6069](https://github.com/JabRef/jabref/issues/6069)
- We fixed an issue that merging idnetical colors. [#6175](https://github.com/JabRef/jabref/issues/6175)

### Removed

Expand Down
31 changes: 29 additions & 2 deletions src/main/java/org/jabref/gui/maintable/MainTableColumnFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import javax.swing.undo.UndoManager;
Expand Down Expand Up @@ -180,15 +182,40 @@ private Node createGroupColorRegion(BibEntryTableViewModel entry, List<AbstractG
container.setAlignment(Pos.CENTER_LEFT);
container.setPadding(new Insets(0, 2, 0, 2));

for (Color groupColor : groupColors) {
/*for (Color groupColor : groupColors) {
Rectangle groupRectangle = new Rectangle();
groupRectangle.getStyleClass().add("groupColumnBackground");
groupRectangle.setWidth(3);
groupRectangle.setHeight(18);
groupRectangle.setFill(groupColor);
groupRectangle.setStrokeWidth(1);

container.getChildren().add(groupRectangle);
}*/
if (groupColors.size() == 1) {
Rectangle groupRectangle = new Rectangle();
groupRectangle.getStyleClass().add("groupColumnBackground");
groupRectangle.setWidth(3);
groupRectangle.setHeight(18);
groupRectangle.setFill(groupColor);
groupRectangle.setFill(groupColors.get(0));
groupRectangle.setStrokeWidth(1);

container.getChildren().add(groupRectangle);
} else {
Set < Color > colorSet = new HashSet<>();
for (Color groupColor : groupColors) {
if (!colorSet.contains(groupColor)) {
Rectangle groupRectangle = new Rectangle();
groupRectangle.getStyleClass().add("groupColumnBackground");
groupRectangle.setWidth(3);
groupRectangle.setHeight(18);
groupRectangle.setFill(groupColor);
groupRectangle.setStrokeWidth(1);

container.getChildren().add(groupRectangle);
colorSet.add(groupColor);
}
}
}

String matchedGroupsString = matchedGroups.stream()
Expand Down