Adjust layout with new design (WIP)

- on css there are some changes marked with MK. @Christoph - please
check if those are ok for you, otherwise lets discuss...
- in Formbuilder there is removed the automatic setting of the column
span and index
- Add support for columnIndex as parameter
- setMouseTransparent for addTopLabelTextField is removed (we want that
user can copy text)
- Adjustments in the DAO code are WIP and can be ignored by @Christoph
This commit is contained in:
Manfred Karrer 2018-10-30 01:06:59 -05:00
parent 36838804c8
commit 8566765996
No known key found for this signature in database
GPG key ID: 401250966A6B2C46
21 changed files with 189 additions and 107 deletions

View file

@ -1185,10 +1185,6 @@ dao.cycle.voteReveal=Vote reveal phase
dao.cycle.voteResult=Vote result
dao.cycle.phaseDuration={0} blocks (≈{1}); Block {2} - {3} (≈{4} - ≈{5})
dao.cycle.info.headline=Information
dao.cycle.info.details=Please note:\n\
If you have voted in the blind vote phase you have to be at least once online during the vote reveal phase!
dao.results.cycles.header=Cycles
dao.results.cycles.table.header.cycle=Cycle
dao.results.cycles.table.header.numProposals=Proposals

View file

@ -342,9 +342,32 @@ bg color of non edit textFields: fafafa
-fx-background-radius: 3 3 0 0;
}
/* MK: add grey bg, hide line, add padding, use same style for hyperlink-with-icon */
/*
.jfx-text-field:readonly {
-fx-background-color: transparent;
}
*/
.jfx-text-field:readonly {
-fx-background-color: -bs-rd-grey-medium-light;
-fx-padding: 0.333333em 0.333333em 0.333333em 0.333333em;
}
.jfx-text-field:readonly > .input-line {
-fx-background-color: transparent;
}
.jfx-text-field:readonly > .input-focused-line {
-fx-background-color: transparent;
}
.hyperlink-with-icon {
-fx-background-color: -bs-rd-grey-medium-light;
-fx-padding: 0.333333em 0.333333em 0.333333em 0.333333em;
}
/* MK end */
#info-field {
-fx-prompt-text-fill: -bs-rd-black;
@ -1345,20 +1368,39 @@ textfield */
}
/* TitledGroupBg */
/* MK: change font size of group header to 1.3em*/
/*
.titled-group-bg-label {
-fx-font-size: 1.077em;
-fx-font-family: "IBM Plex Sans Medium";
-fx-text-fill: -bs-rd-black;
-fx-background-color: transparent;
}
.titled-group-bg-label {
-fx-font-size: 1.077em;
-fx-font-family: "IBM Plex Sans Medium";
-fx-text-fill: -bs-rd-black;
-fx-background-color: transparent;
}
*/
.titled-group-bg-label {
-fx-font-size: 1.3em;
-fx-font-family: "IBM Plex Sans Medium";
-fx-text-fill: -bs-rd-black;
-fx-background-color: transparent;
}
.titled-group-bg-label-active {
-fx-font-weight: normal;
-fx-font-size: 1.077em;
-fx-font-size: 1.3em;
-fx-text-fill: -bs-rd-black;
-fx-background-color: transparent;
}
/* MK end */
.titled-group-bg, .titled-group-bg-active {
-fx-body-color: -bs-rd-grey-background;
-fx-border-color: -bs-rd-separator;

View file

@ -26,7 +26,8 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="50"/>
<ColumnConstraints minWidth="10" maxWidth="5"/>
<ColumnConstraints percentWidth="50"/>
</columnConstraints>
</GridPane>

View file

@ -30,6 +30,7 @@ public class BondingDashboardView extends ActivatableView<GridPane, Void> {
private final BsqBalanceUtil bsqBalanceUtil;
private int gridRow = 0;
private int startRow;
///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, lifecycle
@ -41,8 +42,11 @@ public class BondingDashboardView extends ActivatableView<GridPane, Void> {
}
public void initialize() {
startRow = gridRow;
gridRow = bsqBalanceUtil.addGroup(root, gridRow);
gridRow = bsqBalanceUtil.addBondBalanceGroup(root, gridRow);
gridRow = startRow;
int columnIndex = 2;
gridRow = bsqBalanceUtil.addBondBalanceGroup(root, gridRow, columnIndex);
}
@Override

View file

@ -27,8 +27,7 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -27,8 +27,7 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -27,8 +27,7 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -57,9 +57,7 @@ public class PhasesView implements DaoStateListener {
public int addGroup(GridPane gridPane, int gridRow) {
addTitledGroupBg(gridPane, gridRow, 1, Res.get("dao.cycle.headline"));
separatedPhaseBars = createSeparatedPhaseBars();
GridPane.setColumnSpan(separatedPhaseBars, 2);
GridPane.setColumnIndex(separatedPhaseBars, 0);
GridPane.setMargin(separatedPhaseBars, new Insets(Layout.FIRST_ROW_DISTANCE - 6, 0, 0, 0));
GridPane.setMargin(separatedPhaseBars, new Insets(Layout.FIRST_ROW_DISTANCE + 5, 0, 0, 0));
GridPane.setRowIndex(separatedPhaseBars, gridRow);
gridPane.getChildren().add(separatedPhaseBars);
return gridRow;

View file

@ -26,7 +26,6 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -40,9 +40,8 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import static bisq.desktop.util.FormBuilder.addMultilineLabel;
import static bisq.desktop.util.FormBuilder.addTitledGroupBg;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelReadOnlyTextField;
// We use here ChainHeightListener because we are interested in period changes not in the result of a completed
// block. The event from the ChainHeightListener is sent before parsing starts.
@ -73,16 +72,13 @@ public class ProposalDashboardView extends ActivatableView<GridPane, Void> imple
gridRow = phasesView.addGroup(root, gridRow);
addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.cycle.overview.headline"), Layout.GROUP_DISTANCE);
currentBlockHeightTextField = addTopLabelTextField(root, gridRow, Res.get("dao.cycle.currentBlockHeight"),
"", Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
currentPhaseTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.cycle.currentPhase"), "").second;
proposalTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.cycle.proposal"), "").second;
blindVoteTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.cycle.blindVote"), "").second;
voteRevealTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.cycle.voteReveal"), "").second;
voteResultTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.cycle.voteResult"), "").second;
addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.cycle.info.headline"), Layout.GROUP_DISTANCE);
addMultilineLabel(root, gridRow, Res.get("dao.cycle.info.details"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
currentBlockHeightTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.cycle.currentBlockHeight"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
currentPhaseTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.currentPhase")).second;
proposalTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.proposal")).second;
blindVoteTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.blindVote")).second;
voteRevealTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.voteReveal")).second;
voteResultTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.voteResult")).second;
}
@Override

View file

@ -26,7 +26,6 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -131,6 +131,7 @@ public class MakeProposalView extends ActivatableView<GridPane, Void> implements
addTitledGroupBg(root, ++gridRow, 1, Res.get("dao.proposal.create.selectProposalType"), Layout.GROUP_DISTANCE);
proposalTypeComboBox = FormBuilder.<ProposalType>addComboBox(root, gridRow,
Res.getWithCol("dao.proposal.create.proposalType"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
proposalTypeComboBox.setMaxWidth(300);
proposalTypeComboBox.setConverter(new StringConverter<>() {
@Override
public String toString(ProposalType proposalType) {

View file

@ -27,7 +27,6 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -27,7 +27,6 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -63,53 +63,44 @@ public class BsqBalanceUtil implements BsqBalanceListener {
}
public int addGroup(GridPane gridPane, int gridRow) {
titledGroupBg = addTitledGroupBg(gridPane, gridRow, 5, Res.get("dao.wallet.dashboard.myBalance"));
availableBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, gridRow,
Res.getWithCol("dao.availableBsqBalance"),
Layout.FIRST_ROW_DISTANCE).second;
availableBalanceTextField.setMouseTransparent(false);
titledGroupBg = addTitledGroupBg(gridPane, gridRow, 6, Res.get("dao.wallet.dashboard.myBalance"));
unverifiedBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow,
Res.getWithCol("dao.unverifiedBsqBalance")).second;
unverifiedBalanceTextField.setMouseTransparent(false);
availableBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, gridRow,
Res.get("dao.availableBsqBalance"), Layout.FIRST_ROW_DISTANCE).second;
lockedForVoteBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow,
Res.getWithCol("dao.lockedForVoteBalance")).second;
lockedForVoteBalanceTextField.setMouseTransparent(false);
unverifiedBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow,
Res.get("dao.unverifiedBsqBalance")).second;
lockedInBondsBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.getWithCol(
"dao.lockedInBonds")).second;
lockedInBondsBalanceTextField.setMouseTransparent(false);
lockedForVoteBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow,
Res.get("dao.lockedForVoteBalance")).second;
lockedInBondsBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow,
Res.get("dao.lockedInBonds")).second;
// TODO add unlockingBondsBalanceTextField
totalBalanceTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow,
Res.getWithCol("dao.totalBsqBalance")).second;
totalBalanceTextField.setMouseTransparent(false);
totalBalanceTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow,
Res.get("dao.totalBsqBalance")).second;
Tuple3<Label, TextField, VBox> tuple3 = FormBuilder.addTopLabelTextField(gridPane, ++gridRow,
Res.getWithCol("dao.availableNonBsqBalance"));
Tuple3<Label, TextField, VBox> tuple3 = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow,
Res.get("dao.availableNonBsqBalance"));
availableNonBsqBalanceLabel = tuple3.first;
availableNonBsqBalanceTextField = tuple3.second;
availableNonBsqBalanceTextField.setMouseTransparent(false);
availableNonBsqBalanceTextField.setVisible(false);
availableNonBsqBalanceTextField.setManaged(false);
return gridRow;
}
public int addBondBalanceGroup(GridPane gridPane, int gridRow) {
addTitledGroupBg(gridPane, ++gridRow, 2,
Res.get("dao.bonding.dashboard.bondsHeadline"), Layout.GROUP_DISTANCE);
public int addBondBalanceGroup(GridPane gridPane, int gridRow, int columnIndex) {
addTitledGroupBg(gridPane, gridRow, columnIndex, 6,
Res.get("dao.bonding.dashboard.bondsHeadline"));
lockupAmountTextField = FormBuilder.addTopLabelTextField(gridPane, gridRow,
lockupAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, gridRow, columnIndex,
Res.get("dao.bonding.dashboard.lockupAmount"),
Layout.FIRST_ROW_DISTANCE + Layout.GROUP_DISTANCE).second;
lockupAmountTextField.setMouseTransparent(false);
unlockingAmountTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow,
Layout.FIRST_ROW_DISTANCE).second;
unlockingAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, ++gridRow, columnIndex,
Res.get("dao.bonding.dashboard.unlockingAmount")).second;
unlockingAmountTextField.setMouseTransparent(false);
return gridRow;
}
@ -138,8 +129,6 @@ public class BsqBalanceUtil implements BsqBalanceListener {
Coin unlockingBondsBalance) {
boolean isNonBsqBalanceAvailable = availableNonBsqBalance.value > 0;
int rowSpan = isNonBsqBalanceAvailable ? 6 : 5;
GridPane.setRowSpan(titledGroupBg, rowSpan);
availableBalanceTextField.setText(bsqFormatter.formatCoinWithCode(availableBalance));
unverifiedBalanceTextField.setText(bsqFormatter.formatCoinWithCode(unverifiedBalance));

View file

@ -26,7 +26,8 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="50"/>
<ColumnConstraints minWidth="10" maxWidth="5"/>
<ColumnConstraints percentWidth="50"/>
</columnConstraints>
</GridPane>

View file

@ -48,9 +48,8 @@ import javafx.scene.layout.GridPane;
import javafx.beans.value.ChangeListener;
import static bisq.desktop.util.FormBuilder.addLabelHyperlinkWithIcon;
import static bisq.desktop.util.FormBuilder.addTitledGroupBg;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelReadOnlyTextField;
@FxmlView
public class BsqDashboardView extends ActivatableView<GridPane, Void> implements DaoStateListener {
@ -89,38 +88,52 @@ public class BsqDashboardView extends ActivatableView<GridPane, Void> implements
@Override
public void initialize() {
int startRow = gridRow;
gridRow = bsqBalanceUtil.addGroup(root, gridRow);
addTitledGroupBg(root, ++gridRow, 5, Res.get("dao.wallet.dashboard.distribution"), Layout.GROUP_DISTANCE);
genesisIssueAmountTextField = FormBuilder.addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
compRequestIssueAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
reimbursementAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementAmount")).second;
burntAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
gridRow = startRow;
int columnIndex = 2;
addTitledGroupBg(root, gridRow, columnIndex, 6, Res.get("dao.wallet.dashboard.distribution"));
genesisIssueAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, columnIndex, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_DISTANCE).second;
compRequestIssueAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
reimbursementAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.reimbursementAmount")).second;
burntAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.availableAmount")).second;
++gridRow; // we need 6 rows as well (availableNonBsqBalanceTextField can be invisible but we need so support it)
startRow = gridRow;
addTitledGroupBg(root, ++gridRow, 3, Res.get("dao.wallet.dashboard.locked"), Layout.GROUP_DISTANCE);
totalLockedUpAmountTextField = FormBuilder.addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.totalLockedUpAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
totalUnlockingAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.totalUnlockingAmount")).second;
totalUnlockedAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.totalUnlockedAmount")).second;
totalLockedUpAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.totalLockedUpAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
totalUnlockingAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.totalUnlockingAmount")).second;
totalUnlockedAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.totalUnlockedAmount")).second;
addTitledGroupBg(root, ++gridRow, 2, Res.get("dao.wallet.dashboard.market"), Layout.GROUP_DISTANCE);
priceTextField = FormBuilder.addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.price"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
marketCapTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.marketCap")).second;
gridRow = startRow;
addTitledGroupBg(root, ++gridRow, columnIndex, 3, Res.get("dao.wallet.dashboard.market"), Layout.GROUP_DISTANCE);
priceTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, columnIndex, Res.get("dao.wallet.dashboard.price"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
marketCapTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.marketCap")).second;
++gridRow; // we need 3 rows as well
startRow = gridRow;
addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"),
String.valueOf(daoFacade.getGenesisBlockHeight()), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
hyperlinkWithIcon = addLabelHyperlinkWithIcon(root, ++gridRow, Res.get("dao.wallet.dashboard.genesisTxId"),
daoFacade.getGenesisTxId(), preferences.getBsqBlockChainExplorer().txUrl + daoFacade.getGenesisTxId()).second;
hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", daoFacade.getGenesisTxId())));
allTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second;
utxoTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
compensationIssuanceTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compensationIssuanceTx")).second;
reimbursementIssuanceTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementIssuanceTx")).second;
burntTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntTx")).second;
addTitledGroupBg(root, ++gridRow, 4, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
String genTxHeight = String.valueOf(daoFacade.getGenesisBlockHeight());
String genesisTxId = daoFacade.getGenesisTxId();
String url = preferences.getBsqBlockChainExplorer().txUrl + genesisTxId;
addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"), genTxHeight, Layout.FIRST_ROW_AND_GROUP_DISTANCE);
hyperlinkWithIcon = FormBuilder.addTopLabelHyperlinkWithIcon(root, ++gridRow, Res.get("dao.wallet.dashboard.genesisTxId"), genesisTxId, url, 0).second;
hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", genesisTxId)));
allTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second;
utxoTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
gridRow = startRow;
// We want closing line, so we add an invisible dummy group header
addTitledGroupBg(root, ++gridRow, columnIndex, 4, "", Layout.GROUP_DISTANCE);
compensationIssuanceTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, columnIndex, Res.get("dao.wallet.dashboard.compensationIssuanceTx"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
reimbursementIssuanceTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.reimbursementIssuanceTx")).second;
burntTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.burntTx")).second;
++gridRow; // we need 4 rows as well
priceChangeListener = (observable, oldValue, newValue) -> updatePrice();
}

View file

@ -27,8 +27,7 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -27,7 +27,6 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -26,8 +26,7 @@
AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="20.0"
xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="160.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
<ColumnConstraints percentWidth="100"/>
</columnConstraints>
</GridPane>

View file

@ -128,13 +128,24 @@ public class FormBuilder {
return addTitledGroupBg(gridPane, rowIndex, rowSpan, title, 0);
}
public static TitledGroupBg addTitledGroupBg(GridPane gridPane, int rowIndex, int columnIndex, int rowSpan, String title) {
TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, rowIndex, rowSpan, title, 0);
GridPane.setColumnIndex(titledGroupBg, columnIndex);
return titledGroupBg;
}
public static TitledGroupBg addTitledGroupBg(GridPane gridPane, int rowIndex, int columnIndex, int rowSpan, String title, double top) {
TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, rowIndex, rowSpan, title, top);
GridPane.setColumnIndex(titledGroupBg, columnIndex);
return titledGroupBg;
}
public static TitledGroupBg addTitledGroupBg(GridPane gridPane, int rowIndex, int rowSpan, String title, double top) {
TitledGroupBg titledGroupBg = new TitledGroupBg();
titledGroupBg.setText(title);
titledGroupBg.prefWidthProperty().bind(gridPane.widthProperty());
GridPane.setRowIndex(titledGroupBg, rowIndex);
GridPane.setRowSpan(titledGroupBg, rowSpan);
GridPane.setColumnSpan(titledGroupBg, 2);
GridPane.setMargin(titledGroupBg, new Insets(top, -10, -10, -10));
gridPane.getChildren().add(titledGroupBg);
return titledGroupBg;
@ -212,6 +223,30 @@ public class FormBuilder {
// Label + TextField
///////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<Label, TextField, VBox> addTopLabelReadOnlyTextField(GridPane gridPane, int rowIndex, String title) {
return addTopLabelTextField(gridPane, rowIndex, title, "", -15);
}
public static Tuple3<Label, TextField, VBox> addTopLabelReadOnlyTextField(GridPane gridPane, int rowIndex, int columnIndex, String title) {
Tuple3<Label, TextField, VBox> tuple = addTopLabelTextField(gridPane, rowIndex, title, "", -15);
GridPane.setColumnIndex(tuple.third, columnIndex);
return tuple;
}
public static Tuple3<Label, TextField, VBox> addTopLabelReadOnlyTextField(GridPane gridPane, int rowIndex, String title, double top) {
return addTopLabelTextField(gridPane, rowIndex, title, "", top - 15);
}
public static Tuple3<Label, TextField, VBox> addTopLabelReadOnlyTextField(GridPane gridPane, int rowIndex, int columnIndex, String title, double top) {
Tuple3<Label, TextField, VBox> tuple = addTopLabelTextField(gridPane, rowIndex, title, "", top - 15);
GridPane.setColumnIndex(tuple.third, columnIndex);
return tuple;
}
public static Tuple3<Label, TextField, VBox> addTopLabelReadOnlyTextField(GridPane gridPane, int rowIndex, String title, String value, double top) {
return addTopLabelTextField(gridPane, rowIndex, title, value, top - 15);
}
public static Tuple3<Label, TextField, VBox> addTopLabelTextField(GridPane gridPane, int rowIndex, String title) {
return addTopLabelTextField(gridPane, rowIndex, title, "", 0);
}
@ -227,7 +262,10 @@ public class FormBuilder {
public static Tuple3<Label, TextField, VBox> addTopLabelTextField(GridPane gridPane, int rowIndex, String title, String value, double top) {
TextField textField = new JFXTextField(value);
textField.setEditable(false);
textField.setMouseTransparent(true);
// MK: basically we want that text is copyable, not sure if it breaks anything if mouseTransparent is not set
//textField.setMouseTransparent(true);
textField.setFocusTraversable(false);
final Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, textField, top);
@ -300,12 +338,26 @@ public class FormBuilder {
HyperlinkWithIcon hyperlinkWithIcon = new HyperlinkWithIcon(title, AwesomeIcon.EXTERNAL_LINK);
hyperlinkWithIcon.setOnAction(e -> GUIUtil.openWebPage(url));
GridPane.setRowIndex(hyperlinkWithIcon, rowIndex);
GridPane.setColumnIndex(hyperlinkWithIcon, 1);
GridPane.setMargin(hyperlinkWithIcon, new Insets(top, 0, 0, -4));
gridPane.getChildren().add(hyperlinkWithIcon);
return new Tuple2<>(label, hyperlinkWithIcon);
}
public static Tuple3<Label, HyperlinkWithIcon, VBox> addTopLabelHyperlinkWithIcon(GridPane gridPane,
int rowIndex,
String title,
String value,
String url,
double top) {
HyperlinkWithIcon hyperlinkWithIcon = new HyperlinkWithIcon(value, AwesomeIcon.EXTERNAL_LINK);
hyperlinkWithIcon.setOnAction(e -> GUIUtil.openWebPage(url));
hyperlinkWithIcon.getStyleClass().add("hyperlink-with-icon");
GridPane.setRowIndex(hyperlinkWithIcon, rowIndex);
Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, hyperlinkWithIcon, top - 15);
return new Tuple3<>(topLabelWithVBox.first, hyperlinkWithIcon, topLabelWithVBox.second);
}
///////////////////////////////////////////////////////////////////////////////////////////
// TextArea
///////////////////////////////////////////////////////////////////////////////////////////
@ -1018,7 +1070,6 @@ public class FormBuilder {
BsqAddressTextField addressTextField = new BsqAddressTextField();
GridPane.setRowIndex(addressTextField, rowIndex);
GridPane.setColumnIndex(addressTextField, 1);
GridPane.setMargin(addressTextField, new Insets(top, 0, 0, 0));
gridPane.getChildren().add(addressTextField);