From 379ac6d265caf436c356edf89014e65eaadc3aa6 Mon Sep 17 00:00:00 2001
From: preland <89992615+preland@users.noreply.github.com>
Date: Wed, 20 Mar 2024 08:16:04 -0500
Subject: [PATCH] fix open offers scrolling
---
.../pendingtrades/PendingTradesView.fxml | 8 +++++++-
.../pendingtrades/PendingTradesView.java | 16 ++++++++++------
.../portfolio/pendingtrades/TradeSubView.java | 2 +-
.../steps/buyer/BuyerStep2View.java | 11 +++++++++++
.../java/haveno/desktop/util/FormBuilder.java | 6 +++---
5 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.fxml b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.fxml
index 29dec24a74..c0240455f2 100644
--- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.fxml
+++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.fxml
@@ -19,13 +19,15 @@
+
+
-
+
@@ -43,4 +45,8 @@
+
+
diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java
index 6df3a7c0a4..5da38d8728 100644
--- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java
+++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/PendingTradesView.java
@@ -75,6 +75,7 @@ import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.MenuItem;
+import javafx.scene.control.ScrollPane;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
@@ -84,7 +85,6 @@ import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
-import javafx.scene.layout.Priority;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
@@ -117,6 +117,8 @@ public class PendingTradesView extends ActivatableViewAndModel priceColumn, volumeColumn, amountColumn, avatarColumn,
marketColumn, roleColumn, paymentMethodColumn, tradeIdColumn, dateColumn, chatColumn, moveTradeToFailedColumn;
+ @FXML
+ ScrollPane scrollView;
private FilteredList filteredList;
private SortedList sortedList;
private TradeSubView selectedSubView;
@@ -275,6 +277,8 @@ public class PendingTradesView extends ActivatableViewAndModel(filteredList);
sortedList.comparatorProperty().bind(tableView.comparatorProperty());
tableView.setItems(sortedList);
+ tableView.setPrefHeight(100);
+ tableView.setMaxHeight(200);
filterBox.initialize(filteredList, tableView); // here because filteredList is instantiated here
filterBox.activate();
@@ -295,13 +299,13 @@ public class PendingTradesView extends ActivatableViewAndModel";
TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 4,
@@ -228,6 +231,14 @@ public class BuyerStep2View extends TradeStepView {
Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE).second;
field.setCopyWithoutCurrencyPostFix(true);
+ //preland: this fixes a textarea layout glitch
+ TextArea uiHack = new TextArea();
+ uiHack.setMaxHeight(1);
+ GridPane.setRowIndex(uiHack, 1);
+ GridPane.setMargin(uiHack, new Insets(0, 0, 0, 0));
+ uiHack.setVisible(false);
+ gridPane.getChildren().add(uiHack);
+
switch (paymentMethodId) {
case PaymentMethod.UPHOLD_ID:
gridRow = UpholdForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
diff --git a/desktop/src/main/java/haveno/desktop/util/FormBuilder.java b/desktop/src/main/java/haveno/desktop/util/FormBuilder.java
index d34d65eaf9..57c09c2f13 100644
--- a/desktop/src/main/java/haveno/desktop/util/FormBuilder.java
+++ b/desktop/src/main/java/haveno/desktop/util/FormBuilder.java
@@ -645,7 +645,7 @@ public class FormBuilder {
TextArea textArea = new HavenoTextArea();
textArea.setPromptText(prompt);
textArea.setWrapText(true);
-
+ textArea.setPrefHeight(100);
final Tuple2