Show proposal txId with explore and copy icons.

This commit is contained in:
jmacxx 2022-01-18 13:31:51 -06:00
parent 732b550954
commit 1f917fa19d
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -21,6 +21,7 @@ import bisq.desktop.Navigation;
import bisq.desktop.components.HyperlinkWithIcon; import bisq.desktop.components.HyperlinkWithIcon;
import bisq.desktop.components.InputTextField; import bisq.desktop.components.InputTextField;
import bisq.desktop.components.TitledGroupBg; import bisq.desktop.components.TitledGroupBg;
import bisq.desktop.components.TxIdTextField;
import bisq.desktop.main.MainView; import bisq.desktop.main.MainView;
import bisq.desktop.main.dao.DaoView; import bisq.desktop.main.dao.DaoView;
import bisq.desktop.main.dao.bonding.BondingView; import bisq.desktop.main.dao.bonding.BondingView;
@ -130,7 +131,7 @@ public class ProposalDisplay {
@Getter @Getter
private int gridRow; private int gridRow;
private HyperlinkWithIcon linkHyperlinkWithIcon; private HyperlinkWithIcon linkHyperlinkWithIcon;
private HyperlinkWithIcon txHyperlinkWithIcon; private TxIdTextField txIdTextField;
private int gridRowStartIndex; private int gridRowStartIndex;
private final List<Runnable> inputChangedListeners = new ArrayList<>(); private final List<Runnable> inputChangedListeners = new ArrayList<>();
@Getter @Getter
@ -258,11 +259,9 @@ public class ProposalDisplay {
linkWithIconContainer.setManaged(false); linkWithIconContainer.setManaged(false);
if (!isMakeProposalScreen) { if (!isMakeProposalScreen) {
Tuple3<Label, HyperlinkWithIcon, VBox> uidTuple = addTopLabelHyperlinkWithIcon(gridPane, ++gridRow, final Tuple3<Label, TxIdTextField, VBox> labelTxIdTextFieldVBoxTuple3 =
Res.get("dao.proposal.display.txId"), "", "", 0); addTopLabelTxIdTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.txId"), -10d);
txHyperlinkWithIcon = uidTuple.second; txIdTextField = labelTxIdTextFieldVBoxTuple3.second;
// TODO HyperlinkWithIcon does not scale automatically (button base, -> make anchorPane as base)
txHyperlinkWithIcon.prefWidthProperty().bind(nameTextField.widthProperty());
} }
int comboBoxValueTextFieldIndex = -1; int comboBoxValueTextFieldIndex = -1;
@ -527,10 +526,8 @@ public class ProposalDisplay {
linkHyperlinkWithIcon.setOnAction(e -> GUIUtil.openWebPage(proposal.getLink())); linkHyperlinkWithIcon.setOnAction(e -> GUIUtil.openWebPage(proposal.getLink()));
} }
if (txHyperlinkWithIcon != null) { if (txIdTextField != null) {
txHyperlinkWithIcon.setText(proposal.getTxId()); txIdTextField.setup(proposal.getTxId());
txHyperlinkWithIcon.setOnAction(e ->
GUIUtil.openTxInBsqBlockExplorer(proposal.getTxId(), preferences));
} }
if (proposal instanceof CompensationProposal) { if (proposal instanceof CompensationProposal) {