From 74bedff837389998e63e33eaf8700b182990a147 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Wed, 19 Nov 2014 02:25:46 +0100 Subject: [PATCH] Scroll down to important content #226 --- .../pending/PendingTradesViewCB.java | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesViewCB.java b/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesViewCB.java index f052574293..762277b89b 100644 --- a/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/portfolio/pending/PendingTradesViewCB.java @@ -119,13 +119,6 @@ public class PendingTradesViewCB extends CachedViewCB { setVolumeColumnCellFactory(); setDateColumnCellFactory(); - /* scrollPane.vvalueProperty().addListener((ov, oldValue, newValue) -> { - log.debug("#### vvalueProperty " + newValue); - }); - scrollPane.viewportBoundsProperty().addListener((ov, oldValue, newValue) -> { - log.debug("#### viewportBoundsProperty " + newValue); - });*/ - table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); table.setPlaceholder(new Label("No pending trades available")); @@ -493,12 +486,7 @@ public class PendingTradesViewCB extends CachedViewCB { fiatAmountTextField.setManaged(visible); holderNameTextField.setManaged(visible); - - if (visible) - scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); - else - scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); - scrollPane.layout(); + Platform.runLater(() -> scrollPane.setVvalue(visible ? scrollPane.getVmax() : 0)); } private void setSummaryControlsVisible(boolean visible) { @@ -538,15 +526,10 @@ public class PendingTradesViewCB extends CachedViewCB { withdrawAddressTextField.setManaged(visible); withdrawButton.setManaged(visible); - if (visible) { - scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); + if (visible) withdrawAddressTextField.requestFocus(); - scrollPane.setVvalue(scrollPane.getVmax()); - } - else { - scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); - } - scrollPane.layout(); + + Platform.runLater(() -> scrollPane.setVvalue(visible ? scrollPane.getVmax() : 0)); }