diff --git a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java index caa01deea4a..14c78bf5b91 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java @@ -85,10 +85,10 @@ import javafx.scene.control.TableView; import javafx.scene.control.Tooltip; import javafx.scene.image.ImageView; -import javafx.scene.layout.AnchorPane; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import javafx.scene.text.TextAlignment; @@ -113,6 +113,8 @@ import java.util.Comparator; import java.util.Optional; +import org.jetbrains.annotations.NotNull; + import static bisq.desktop.util.FormBuilder.addTitledGroupBg; @FxmlView @@ -173,10 +175,10 @@ public void initialize() { final TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, 2, Res.get("offerbook.availableOffers")); titledGroupBg.getStyleClass().add("last"); - HBox hBox = new HBox(); - hBox.setAlignment(Pos.CENTER_LEFT); - hBox.setSpacing(35); - hBox.setPadding(new Insets(10, 0, 0, 0)); + HBox offerToolsBox = new HBox(); + offerToolsBox.setAlignment(Pos.BOTTOM_LEFT); + offerToolsBox.setSpacing(10); + offerToolsBox.setPadding(new Insets(10, 0, 0, 0)); Tuple3> currencyBoxTuple = FormBuilder.addTopLabelAutocompleteComboBox( Res.get("offerbook.filterByCurrency")); @@ -193,25 +195,19 @@ public void initialize() { matchingOffersToggle.setText(Res.get("offerbook.matchingOffers")); HBox.setMargin(matchingOffersToggle, new Insets(7, 0, -9, -15)); - hBox.getChildren().addAll(currencyBoxTuple.first, paymentBoxTuple.first, matchingOffersToggle); - AnchorPane.setLeftAnchor(hBox, 0d); - AnchorPane.setTopAnchor(hBox, 0d); - AnchorPane.setBottomAnchor(hBox, 0d); createOfferButton = new AutoTooltipButton(); createOfferButton.setMinHeight(40); createOfferButton.setGraphicTextGap(10); - AnchorPane.setRightAnchor(createOfferButton, 0d); - AnchorPane.setBottomAnchor(createOfferButton, 0d); - AnchorPane anchorPane = new AnchorPane(); - anchorPane.getChildren().addAll(hBox, createOfferButton); + offerToolsBox.getChildren().addAll(currencyBoxTuple.first, paymentBoxTuple.first, + matchingOffersToggle, getSpacer(), createOfferButton); - GridPane.setHgrow(anchorPane, Priority.ALWAYS); - GridPane.setRowIndex(anchorPane, gridRow); - GridPane.setColumnSpan(anchorPane, 2); - GridPane.setMargin(anchorPane, new Insets(Layout.FIRST_ROW_DISTANCE, 0, 0, 0)); - root.getChildren().add(anchorPane); + GridPane.setHgrow(offerToolsBox, Priority.ALWAYS); + GridPane.setRowIndex(offerToolsBox, gridRow); + GridPane.setColumnSpan(offerToolsBox, 2); + GridPane.setMargin(offerToolsBox, new Insets(Layout.FIRST_ROW_DISTANCE, 0, 0, 0)); + root.getChildren().add(offerToolsBox); tableView = new TableView<>(); @@ -453,7 +449,7 @@ protected void deactivate() { } static class CurrencyStringConverter extends StringConverter { - private ComboBox comboBox; + private final ComboBox comboBox; CurrencyStringConverter(ComboBox comboBox) { this.comboBox = comboBox; @@ -497,7 +493,7 @@ private TradeCurrency specialShowAllItem() { } static class PaymentMethodStringConverter extends StringConverter { - private ComboBox comboBox; + private final ComboBox comboBox; PaymentMethodStringConverter(ComboBox comboBox) { this.comboBox = comboBox; @@ -1134,8 +1130,6 @@ private AutoTooltipTableColumn getSigningS @Override public TableCell call(TableColumn column) { return new TableCell<>() { - private HyperlinkWithIcon field; - @Override public void updateItem(final OfferBookListItem item, boolean empty) { super.updateItem(item, empty); @@ -1199,4 +1193,11 @@ public void updateItem(final OfferBookListItem newItem, boolean empty) { }); return column; } + + @NotNull + private Region getSpacer() { + final Region spacer = new Region(); + HBox.setHgrow(spacer, Priority.ALWAYS); + return spacer; + } }