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

Show proposal txId with explore and copy icons. #5977

Merged
merged 1 commit into from Jan 19, 2022
Merged
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 @@ -21,6 +21,7 @@
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;
Expand Down Expand Up @@ -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<Runnable> inputChangedListeners = new ArrayList<>();
@Getter
Expand Down Expand Up @@ -258,11 +259,9 @@ public void createAllFields(String title, int gridRowStartIndex, double top, Pro
linkWithIconContainer.setManaged(false);

if (!isMakeProposalScreen) {
Tuple3<Label, HyperlinkWithIcon, VBox> 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<Label, TxIdTextField, VBox> labelTxIdTextFieldVBoxTuple3 =
addTopLabelTxIdTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.txId"), -10d);
txIdTextField = labelTxIdTextFieldVBoxTuple3.second;
}

int comboBoxValueTextFieldIndex = -1;
Expand Down Expand Up @@ -527,10 +526,8 @@ public void applyProposalPayload(Proposal proposal) {
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) {
Expand Down