From 1f917fa19dbecc6bca3ee87b3546ec0d74519104 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:31:51 -0600 Subject: [PATCH] Show proposal txId with explore and copy icons. --- .../main/dao/governance/ProposalDisplay.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java b/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java index edf96413c8..4d7faf0b85 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/governance/ProposalDisplay.java @@ -21,6 +21,7 @@ import bisq.desktop.Navigation; import bisq.desktop.components.HyperlinkWithIcon; import bisq.desktop.components.InputTextField; import bisq.desktop.components.TitledGroupBg; +import bisq.desktop.components.TxIdTextField; import bisq.desktop.main.MainView; import bisq.desktop.main.dao.DaoView; import bisq.desktop.main.dao.bonding.BondingView; @@ -130,7 +131,7 @@ public class ProposalDisplay { @Getter private int gridRow; private HyperlinkWithIcon linkHyperlinkWithIcon; - private HyperlinkWithIcon txHyperlinkWithIcon; + private TxIdTextField txIdTextField; private int gridRowStartIndex; private final List inputChangedListeners = new ArrayList<>(); @Getter @@ -258,11 +259,9 @@ public class ProposalDisplay { linkWithIconContainer.setManaged(false); if (!isMakeProposalScreen) { - Tuple3 uidTuple = addTopLabelHyperlinkWithIcon(gridPane, ++gridRow, - Res.get("dao.proposal.display.txId"), "", "", 0); - txHyperlinkWithIcon = uidTuple.second; - // TODO HyperlinkWithIcon does not scale automatically (button base, -> make anchorPane as base) - txHyperlinkWithIcon.prefWidthProperty().bind(nameTextField.widthProperty()); + final Tuple3 labelTxIdTextFieldVBoxTuple3 = + addTopLabelTxIdTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.txId"), -10d); + txIdTextField = labelTxIdTextFieldVBoxTuple3.second; } int comboBoxValueTextFieldIndex = -1; @@ -527,10 +526,8 @@ public class ProposalDisplay { linkHyperlinkWithIcon.setOnAction(e -> GUIUtil.openWebPage(proposal.getLink())); } - if (txHyperlinkWithIcon != null) { - txHyperlinkWithIcon.setText(proposal.getTxId()); - txHyperlinkWithIcon.setOnAction(e -> - GUIUtil.openTxInBsqBlockExplorer(proposal.getTxId(), preferences)); + if (txIdTextField != null) { + txIdTextField.setup(proposal.getTxId()); } if (proposal instanceof CompensationProposal) {