mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Improve layout
This commit is contained in:
parent
97ccd6ad99
commit
9d265d8914
2 changed files with 13 additions and 3 deletions
|
@ -57,17 +57,18 @@ public class SpecificBankForm extends BankForm {
|
|||
protected void addAcceptedBanksForAddAccount() {
|
||||
Tuple3<Label, InputTextField, Button> addBankTuple = addLabelInputTextFieldButton(gridPane, ++gridRow, "Add name of accepted bank:", "Add accepted bank");
|
||||
InputTextField addBankInputTextField = addBankTuple.second;
|
||||
addBankInputTextField.setMinWidth(300);
|
||||
Button addButton = addBankTuple.third;
|
||||
addButton.setMinWidth(200);
|
||||
addButton.disableProperty().bind(Bindings.createBooleanBinding(() -> addBankInputTextField.getText().isEmpty(), addBankInputTextField.textProperty()));
|
||||
|
||||
Tuple3<Label, TextField, Button> acceptedBanksTuple = addLabelTextFieldButton(gridPane, ++gridRow, "Accepted banks:", "Clear accepted banks");
|
||||
acceptedBanksTextField = acceptedBanksTuple.second;
|
||||
acceptedBanksTextField.setMinWidth(addBankInputTextField.getMinWidth());
|
||||
acceptedBanksTextField.setMouseTransparent(false);
|
||||
acceptedBanksTooltip = new Tooltip();
|
||||
acceptedBanksTextField.setTooltip(acceptedBanksTooltip);
|
||||
Button clearButton = acceptedBanksTuple.third;
|
||||
clearButton.setMinWidth(200);
|
||||
clearButton.setDefaultButton(false);
|
||||
clearButton.disableProperty().bind(Bindings.createBooleanBinding(() -> acceptedBanksTextField.getText().isEmpty(), acceptedBanksTextField.textProperty()));
|
||||
addButton.setOnAction(e -> {
|
||||
specificBanksAccountContractData.addAcceptedBank(addBankInputTextField.getText());
|
||||
|
|
|
@ -336,10 +336,12 @@ public class FormBuilder {
|
|||
|
||||
InputTextField inputTextField = new InputTextField();
|
||||
Button button = new Button(buttonTitle);
|
||||
button.setDefaultButton(true);
|
||||
|
||||
HBox hBox = new HBox();
|
||||
hBox.setSpacing(10);
|
||||
hBox.getChildren().addAll(inputTextField, button);
|
||||
HBox.setHgrow(inputTextField, Priority.ALWAYS);
|
||||
GridPane.setRowIndex(hBox, rowIndex);
|
||||
GridPane.setColumnIndex(hBox, 1);
|
||||
gridPane.getChildren().add(hBox);
|
||||
|
@ -353,19 +355,26 @@ public class FormBuilder {
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public static Tuple3<Label, TextField, Button> addLabelTextFieldButton(GridPane gridPane, int rowIndex, String title, String buttonTitle) {
|
||||
Label label = addLabel(gridPane, rowIndex, title, 0);
|
||||
return addLabelTextFieldButton(gridPane, rowIndex, title, buttonTitle, 0);
|
||||
}
|
||||
|
||||
public static Tuple3<Label, TextField, Button> addLabelTextFieldButton(GridPane gridPane, int rowIndex, String title, String buttonTitle, double top) {
|
||||
Label label = addLabel(gridPane, rowIndex, title, top);
|
||||
|
||||
TextField textField = new TextField();
|
||||
textField.setEditable(false);
|
||||
textField.setMouseTransparent(true);
|
||||
textField.setFocusTraversable(false);
|
||||
Button button = new Button(buttonTitle);
|
||||
button.setDefaultButton(true);
|
||||
|
||||
HBox hBox = new HBox();
|
||||
hBox.setSpacing(10);
|
||||
hBox.getChildren().addAll(textField, button);
|
||||
HBox.setHgrow(textField, Priority.ALWAYS);
|
||||
GridPane.setRowIndex(hBox, rowIndex);
|
||||
GridPane.setColumnIndex(hBox, 1);
|
||||
GridPane.setMargin(hBox, new Insets(top, 0, 0, 0));
|
||||
gridPane.getChildren().add(hBox);
|
||||
|
||||
return new Tuple3<>(label, textField, button);
|
||||
|
|
Loading…
Add table
Reference in a new issue