Fix icon handling in vote result table, fix #2141

This commit is contained in:
sqrrm 2018-12-25 22:07:11 +01:00
parent 5cc3c57d52
commit 9fc76a4cfc
No known key found for this signature in database
GPG Key ID: 45235F9EF87089EC

View File

@ -701,21 +701,14 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements D
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
ProposalListItem> column) {
return new TableCell<>() {
Label myVoteIcon;
@Override
public void updateItem(final ProposalListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
if (myVoteIcon == null) {
myVoteIcon = item.getMyVoteIcon();
setGraphic(myVoteIcon);
}
setGraphic(item.getMyVoteIcon());
} else {
setGraphic(null);
if (myVoteIcon != null)
myVoteIcon = null;
}
}
};
@ -734,21 +727,17 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements D
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
ProposalListItem> column) {
return new TableCell<>() {
Label icon;
@Override
public void updateItem(final ProposalListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
icon = new Label();
Label icon = new Label();
AwesomeDude.setIcon(icon, item.getIcon());
icon.getStyleClass().add(item.getColorStyleClass());
setGraphic(icon);
} else {
setGraphic(null);
if (icon != null)
icon = null;
}
}
};