mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Fix icon handling in vote result table, fix #2141
This commit is contained in:
parent
5cc3c57d52
commit
9fc76a4cfc
@ -701,21 +701,14 @@ public class VoteResultView extends ActivatableView<GridPane, Void> implements D
|
|||||||
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
|
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
|
||||||
ProposalListItem> column) {
|
ProposalListItem> column) {
|
||||||
return new TableCell<>() {
|
return new TableCell<>() {
|
||||||
Label myVoteIcon;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final ProposalListItem item, boolean empty) {
|
public void updateItem(final ProposalListItem item, boolean empty) {
|
||||||
super.updateItem(item, empty);
|
super.updateItem(item, empty);
|
||||||
|
|
||||||
if (item != null && !empty) {
|
if (item != null && !empty) {
|
||||||
if (myVoteIcon == null) {
|
setGraphic(item.getMyVoteIcon());
|
||||||
myVoteIcon = item.getMyVoteIcon();
|
|
||||||
setGraphic(myVoteIcon);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
setGraphic(null);
|
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,
|
public TableCell<ProposalListItem, ProposalListItem> call(TableColumn<ProposalListItem,
|
||||||
ProposalListItem> column) {
|
ProposalListItem> column) {
|
||||||
return new TableCell<>() {
|
return new TableCell<>() {
|
||||||
Label icon;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateItem(final ProposalListItem item, boolean empty) {
|
public void updateItem(final ProposalListItem item, boolean empty) {
|
||||||
super.updateItem(item, empty);
|
super.updateItem(item, empty);
|
||||||
|
|
||||||
if (item != null && !empty) {
|
if (item != null && !empty) {
|
||||||
icon = new Label();
|
Label icon = new Label();
|
||||||
AwesomeDude.setIcon(icon, item.getIcon());
|
AwesomeDude.setIcon(icon, item.getIcon());
|
||||||
icon.getStyleClass().add(item.getColorStyleClass());
|
icon.getStyleClass().add(item.getColorStyleClass());
|
||||||
setGraphic(icon);
|
setGraphic(icon);
|
||||||
} else {
|
} else {
|
||||||
setGraphic(null);
|
setGraphic(null);
|
||||||
if (icon != null)
|
|
||||||
icon = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user