Scroll down to important content #226

This commit is contained in:
Manfred Karrer 2014-11-19 02:25:46 +01:00
parent bd8b39b996
commit 74bedff837

View file

@ -119,13 +119,6 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
setVolumeColumnCellFactory(); setVolumeColumnCellFactory();
setDateColumnCellFactory(); 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.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No pending trades available")); table.setPlaceholder(new Label("No pending trades available"));
@ -493,12 +486,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
fiatAmountTextField.setManaged(visible); fiatAmountTextField.setManaged(visible);
holderNameTextField.setManaged(visible); holderNameTextField.setManaged(visible);
Platform.runLater(() -> scrollPane.setVvalue(visible ? scrollPane.getVmax() : 0));
if (visible)
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
else
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.layout();
} }
private void setSummaryControlsVisible(boolean visible) { private void setSummaryControlsVisible(boolean visible) {
@ -538,15 +526,10 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
withdrawAddressTextField.setManaged(visible); withdrawAddressTextField.setManaged(visible);
withdrawButton.setManaged(visible); withdrawButton.setManaged(visible);
if (visible) { if (visible)
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
withdrawAddressTextField.requestFocus(); withdrawAddressTextField.requestFocus();
scrollPane.setVvalue(scrollPane.getVmax());
} Platform.runLater(() -> scrollPane.setVvalue(visible ? scrollPane.getVmax() : 0));
else {
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
}
scrollPane.layout();
} }