From 2839b7a73aca26851ff54f2d8cf72ac1dc60455f Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Sat, 30 Jan 2021 16:56:02 +0100 Subject: [PATCH 1/3] Prevent overlapping of offer tools Moves everything into box to prevent hiding of information in all languages --- .../main/offer/offerbook/OfferBookView.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) 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..ebf057b91fe 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.CENTER_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<>(); @@ -1199,4 +1195,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; + } } From 4164c77cf9f7492c0b3b86369a5f1b607763ca55 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Sat, 30 Jan 2021 16:56:38 +0100 Subject: [PATCH 2/3] Cleanup code --- .../bisq/desktop/main/offer/offerbook/OfferBookView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 ebf057b91fe..f52547de203 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 @@ -449,7 +449,7 @@ protected void deactivate() { } static class CurrencyStringConverter extends StringConverter { - private ComboBox comboBox; + private final ComboBox comboBox; CurrencyStringConverter(ComboBox comboBox) { this.comboBox = comboBox; @@ -493,7 +493,7 @@ private TradeCurrency specialShowAllItem() { } static class PaymentMethodStringConverter extends StringConverter { - private ComboBox comboBox; + private final ComboBox comboBox; PaymentMethodStringConverter(ComboBox comboBox) { this.comboBox = comboBox; @@ -1130,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); From 1af7e6a971a9174cc47bf45c4e4ced2a8bf492ce Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Mon, 1 Feb 2021 09:30:37 +0100 Subject: [PATCH 3/3] Bottom align elements in offerbook tools box --- .../java/bisq/desktop/main/offer/offerbook/OfferBookView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f52547de203..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 @@ -176,7 +176,7 @@ public void initialize() { titledGroupBg.getStyleClass().add("last"); HBox offerToolsBox = new HBox(); - offerToolsBox.setAlignment(Pos.CENTER_LEFT); + offerToolsBox.setAlignment(Pos.BOTTOM_LEFT); offerToolsBox.setSpacing(10); offerToolsBox.setPadding(new Insets(10, 0, 0, 0));