Not show group separator for last group

This commit is contained in:
Christoph Atteneder 2019-03-20 10:16:04 +01:00
parent 497e202420
commit 8d7a35bd5b
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
13 changed files with 51 additions and 29 deletions

View file

@ -93,7 +93,7 @@ public class BondsView extends ActivatableView<GridPane, Void> {
@Override
public void initialize() {
tableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.bond.allBonds.header"));
tableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.bond.allBonds.header"), "last");
tableView.setItems(sortedList);
addColumns();

View file

@ -42,7 +42,7 @@ public class BondingDashboardView extends ActivatableView<GridPane, Void> {
public void initialize() {
gridRow = bsqBalanceUtil.addGroup(root, gridRow);
gridRow = bsqBalanceUtil.addBondBalanceGroup(root, gridRow);
gridRow = bsqBalanceUtil.addBondBalanceGroup(root, gridRow, "last");
}
@Override

View file

@ -144,7 +144,7 @@ public class MyReputationView extends ActivatableView<GridPane, Void> implements
lockupButton = addButtonAfterGroup(root, ++gridRow, Res.get("dao.bond.reputation.lockupButton"));
tableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.bond.reputation.table.header"), 20);
tableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.bond.reputation.table.header"), 20, "last");
createColumns();
tableView.setItems(sortedList);

View file

@ -93,7 +93,7 @@ public class RolesView extends ActivatableView<GridPane, Void> {
@Override
public void initialize() {
int gridRow = 0;
tableView = FormBuilder.addTableViewWithHeader(root, gridRow, Res.get("dao.bond.bondedRoles"));
tableView = FormBuilder.addTableViewWithHeader(root, gridRow, Res.get("dao.bond.bondedRoles"), "last");
createColumns();
tableView.setItems(sortedList);

View file

@ -141,7 +141,7 @@ public class AssetFeeView extends ActivatableView<GridPane, Void> implements Bsq
payFeeButton = addButtonAfterGroup(root, ++gridRow, Res.get("dao.burnBsq.payFee"));
tableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.burnBsq.allAssets"), 20);
tableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.burnBsq.allAssets"), 20, "last");
createColumns();
tableView.setItems(sortedList);

View file

@ -143,7 +143,7 @@ public class ProofOfBurnView extends ActivatableView<GridPane, Void> implements
createColumnsForMyItems();
myItemsTableView.setItems(myItemsSortedList);
allTxsTableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.proofOfBurn.allTxs"), 30);
allTxsTableView = FormBuilder.addTableViewWithHeader(root, ++gridRow, Res.get("dao.proofOfBurn.allTxs"), 30, "last");
createColumnsForAllTxs();
allTxsTableView.setItems(allItemsSortedList);

View file

@ -19,6 +19,7 @@ package bisq.desktop.main.dao.governance.dashboard;
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
import bisq.desktop.components.TitledGroupBg;
import bisq.desktop.main.dao.governance.PhasesView;
import bisq.desktop.util.Layout;
@ -69,7 +70,8 @@ public class GovernanceDashboardView extends ActivatableView<GridPane, Void> imp
public void initialize() {
gridRow = phasesView.addGroup(root, gridRow);
addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.cycle.overview.headline"), Layout.GROUP_DISTANCE);
TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.cycle.overview.headline"), Layout.GROUP_DISTANCE);
titledGroupBg.getStyleClass().add("last");
currentBlockHeightTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.cycle.currentBlockHeight"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
currentPhaseTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.cycle.currentPhase")).second;

View file

@ -251,8 +251,10 @@ public class MakeProposalView extends ActivatableView<GridPane, Void> implements
isProposalPhase.set(daoFacade.isInPhaseButNotLastBlock(DaoPhase.Phase.PROPOSAL));
if (isProposalPhase.get()) {
proposalGroupTitle.set(Res.get("dao.proposal.create.selectProposalType"));
proposalTitledGroup.getStyleClass().remove("last");
} else {
proposalGroupTitle.set(Res.get("dao.proposal.create.phase.inactive"));
proposalTitledGroup.getStyleClass().add("last");
proposalTypeComboBox.getSelectionModel().clearSelection();
updateTimeUntilNextProposalPhase(block.getHeight());
}

View file

@ -691,6 +691,7 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
private void createVoteView() {
voteTitledGroupBg = addTitledGroupBg(root, ++gridRow, 4,
Res.get("dao.proposal.votes.header"), 20);
voteTitledGroupBg.getStyleClass().add("last");
voteFields.add(voteTitledGroupBg);
Tuple3<Label, TextField, VBox> meritTuple = addTopLabelTextField(root, gridRow,

View file

@ -17,6 +17,7 @@
package bisq.desktop.main.dao.wallet;
import bisq.desktop.components.TitledGroupBg;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
@ -176,10 +177,12 @@ public class BsqBalanceUtil implements BsqBalanceListener, DaoStateListener {
return gridRow;
}
public int addBondBalanceGroup(GridPane gridPane, int gridRow) {
addTitledGroupBg(gridPane, ++gridRow, 2,
public int addBondBalanceGroup(GridPane gridPane, int gridRow, String groupStyle) {
TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2,
Res.get("dao.bond.dashboard.bondsHeadline"), Layout.GROUP_DISTANCE);
if (groupStyle != null) titledGroupBg.getStyleClass().add(groupStyle);
lockupAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(gridPane, gridRow,
Res.get("dao.bond.dashboard.lockupAmount"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;

View file

@ -20,6 +20,7 @@ package bisq.desktop.main.dao.wallet.dashboard;
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
import bisq.desktop.components.HyperlinkWithIcon;
import bisq.desktop.components.TitledGroupBg;
import bisq.desktop.main.dao.wallet.BsqBalanceUtil;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
@ -96,24 +97,24 @@ public class BsqDashboardView extends ActivatableView<GridPane, Void> implements
int startRow = gridRow;
addTitledGroupBg(root, ++gridRow, 5, Res.get("dao.wallet.dashboard.distribution"), Layout.GROUP_DISTANCE);
genesisIssueAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
compRequestIssueAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
reimbursementAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementAmount")).second;
burntAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
genesisIssueAmountTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
compRequestIssueAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
reimbursementAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementAmount")).second;
burntAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
gridRow = startRow;
addTitledGroupBg(root, ++gridRow, columnIndex, 5, Res.get("dao.wallet.dashboard.locked"), Layout.GROUP_DISTANCE);
totalLockedUpAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalLockedUpAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
totalUnlockingAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalUnlockingAmount")).second;
totalUnlockedAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalUnlockedAmount")).second;
totalConfiscatedAmountTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalConfiscatedAmount")).second;
totalLockedUpAmountTextField = addTopLabelReadOnlyTextField(root, gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalLockedUpAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
totalUnlockingAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalUnlockingAmount")).second;
totalUnlockedAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalUnlockedAmount")).second;
totalConfiscatedAmountTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex, Res.get("dao.wallet.dashboard.totalConfiscatedAmount")).second;
gridRow++;
startRow = gridRow;
addTitledGroupBg(root, ++gridRow, 2, Res.get("dao.wallet.dashboard.market"), Layout.GROUP_DISTANCE);
priceTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.price"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
marketCapTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.marketCap")).second;
priceTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.price"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
marketCapTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.marketCap")).second;
gridRow = startRow;
addTitledGroupBg(root, ++gridRow, columnIndex, 2, Res.get("dao.wallet.dashboard.genesis"), Layout.GROUP_DISTANCE);
@ -130,19 +131,21 @@ public class BsqDashboardView extends ActivatableView<GridPane, Void> implements
hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", genesisTxId)));
startRow = gridRow;
addTitledGroupBg(root, ++gridRow, 3, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
allTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.allTx"),
TitledGroupBg titledGroupBgTxDetails = addTitledGroupBg(root, ++gridRow, 3, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
titledGroupBgTxDetails.getStyleClass().add("last");
allTxTextField = addTopLabelReadOnlyTextField(root, gridRow, Res.get("dao.wallet.dashboard.allTx"),
genTxHeight, Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
utxoTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
compensationIssuanceTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow,
utxoTextField = addTopLabelReadOnlyTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
compensationIssuanceTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow,
Res.get("dao.wallet.dashboard.compensationIssuanceTx")).second;
gridRow = startRow;
addTitledGroupBg(root, ++gridRow, columnIndex, 3, "", Layout.GROUP_DISTANCE);
reimbursementIssuanceTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, gridRow, columnIndex,
TitledGroupBg titledGroupBgReImbursement = addTitledGroupBg(root, ++gridRow, columnIndex, 3, "", Layout.GROUP_DISTANCE);
titledGroupBgReImbursement.getStyleClass().add("last");
reimbursementIssuanceTxTextField = addTopLabelReadOnlyTextField(root, gridRow, columnIndex,
Res.get("dao.wallet.dashboard.reimbursementIssuanceTx"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
burntTxTextField = FormBuilder.addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
burntTxTextField = addTopLabelReadOnlyTextField(root, ++gridRow, columnIndex,
Res.get("dao.wallet.dashboard.burntTx")).second;
++gridRow;

View file

@ -67,6 +67,7 @@ public class BsqReceiveView extends ActivatableView<GridPane, Void> {
TitledGroupBg titledGroupBg = addTitledGroupBg(root, ++gridRow, 1,
Res.get("dao.wallet.receive.fundYourWallet"), Layout.GROUP_DISTANCE);
titledGroupBg.getStyleClass().add("last");
GridPane.setColumnSpan(titledGroupBg, 3);
Tuple3<Label, BsqAddressTextField, VBox> tuple = addLabelBsqAddressTextField(root, gridRow,
Res.get("dao.wallet.receive.bsqAddress"),

View file

@ -1743,11 +1743,21 @@ public class FormBuilder {
}
public static <T> TableView<T> addTableViewWithHeader(GridPane gridPane, int rowIndex, String headerText) {
return addTableViewWithHeader(gridPane, rowIndex, headerText, 0);
return addTableViewWithHeader(gridPane, rowIndex, headerText, 0, null);
}
public static <T> TableView<T> addTableViewWithHeader(GridPane gridPane, int rowIndex, String headerText, String groupStyle) {
return addTableViewWithHeader(gridPane, rowIndex, headerText, 0, groupStyle);
}
public static <T> TableView<T> addTableViewWithHeader(GridPane gridPane, int rowIndex, String headerText, int top) {
addTitledGroupBg(gridPane, rowIndex, 1, headerText, top);
return addTableViewWithHeader(gridPane, rowIndex, headerText, top, null);
}
public static <T> TableView<T> addTableViewWithHeader(GridPane gridPane, int rowIndex, String headerText, int top, String groupStyle) {
TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, rowIndex, 1, headerText, top);
if (groupStyle != null) titledGroupBg.getStyleClass().add(groupStyle);
TableView<T> tableView = new TableView<>();
GridPane.setRowIndex(tableView, rowIndex);