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 issue 5152, tooltip and icon added to group cell #5191

Merged
merged 3 commits into from
Aug 18, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MainTableColumnFactory {
private final CellFactory cellFactory;
private final UndoManager undoManager;
private final DialogService dialogService;


public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences preferences, ExternalFileTypes externalFileTypes, UndoManager undoManager, DialogService dialogService) {
this.database = Objects.requireNonNull(database);
Expand All @@ -78,9 +78,7 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre

public List<TableColumn<BibEntryTableViewModel, ?>> createColumns() {
List<TableColumn<BibEntryTableViewModel, ?>> columns = new ArrayList<>();

columns.add(createGroupColumn());

// Add column for linked files
if (preferences.showFileColumn()) {
columns.add(createFileColumn());
Expand Down Expand Up @@ -116,8 +114,11 @@ public MainTableColumnFactory(BibDatabaseContext database, ColumnPreferences pre

private TableColumn<BibEntryTableViewModel, ?> createGroupColumn() {
TableColumn<BibEntryTableViewModel, List<AbstractGroup>> column = new TableColumn<>();
column.getStyleClass().add(GROUP_COLUMN);
setExactWidth(column, 20);
Node headerGraphic = IconTheme.JabRefIcons.DEFAULT_GROUP_ICON.getGraphicNode();
Tooltip.install(headerGraphic, new Tooltip(Localization.lang("Group color")));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to put the key "Group color" into the english language resource file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers for your feedback. I just wonder why codecov/project test failed on the second attempt.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codecov is also a mystery to me. It somehow displays the test coverage of the code, but I have no clue how it calculates. I had an PR where i just changed one line and the coverage changed for about 0.07% from fail to pass. But I think it can be ignored for the most gui-stuff. At least the core developers did not bring it up yet. 😁

column.setGraphic(headerGraphic);
column.getStyleClass().add(ICON_COLUMN);
setExactWidth(column, GUIGlobals.WIDTH_ICON_COL);
column.setCellValueFactory(cellData -> cellData.getValue().getMatchedGroups(database));
new ValueTableCellFactory<BibEntryTableViewModel, List<AbstractGroup>>()
.withGraphic(this::createGroupColorRegion)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2114,3 +2114,4 @@ No\ LaTeX\ files\ containing\ this\ entry\ were\ found.=No LaTeX files containin
Selected\ entry\ does\ not\ have\ an\ associated\ BibTeX\ key.=Selected entry does not have an associated BibTeX key.
Current\ search\ directory\:=Current search directory:
Set\ LaTeX\ file\ directory=Set LaTeX file directory
Group\ color=Group color