Increase height of account list when account is selected to make scrolling easier.

This commit is contained in:
chimp1984 2020-12-01 18:02:23 -05:00
parent 6adf8503df
commit 2ead91c961
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
4 changed files with 12 additions and 2 deletions

View file

@ -157,4 +157,8 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
public void importAccounts(Stage stage) {
GUIUtil.importAccounts(user, accountsFileName, preferences, stage, persistenceProtoResolver, corruptedStorageFileHandler);
}
public int getNumPaymentAccounts() {
return user.getPaymentAccounts() != null ? user.getPaymentAccounts().size() : 0;
}
}

View file

@ -177,7 +177,8 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
Tuple3<Label, ListView<PaymentAccount>, VBox> tuple = addTopLabelListView(root, gridRow, Res.get("account.altcoin.yourAltcoinAccounts"), Layout.FIRST_ROW_DISTANCE);
paymentAccountsListView = tuple.second;
paymentAccountsListView.setMinHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
int prefNumRows = Math.min(4, Math.max(2, model.dataModel.getNumPaymentAccounts()));
paymentAccountsListView.setMinHeight(prefNumRows * Layout.LIST_ROW_HEIGHT + 28);
setPaymentAccountsCellFactory();
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"),

View file

@ -160,4 +160,8 @@ class FiatAccountsDataModel extends ActivatableDataModel {
public void importAccounts(Stage stage) {
GUIUtil.importAccounts(user, accountsFileName, preferences, stage, persistenceProtoResolver, corruptedStorageFileHandler);
}
public int getNumPaymentAccounts() {
return user.getPaymentAccounts() != null ? user.getPaymentAccounts().size() : 0;
}
}

View file

@ -362,7 +362,8 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
Tuple3<Label, ListView<PaymentAccount>, VBox> tuple = addTopLabelListView(root, gridRow, Res.get("account.fiat.yourFiatAccounts"), Layout.FIRST_ROW_DISTANCE);
paymentAccountsListView = tuple.second;
paymentAccountsListView.setMinHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
int prefNumRows = Math.min(4, Math.max(2, model.dataModel.getNumPaymentAccounts()));
paymentAccountsListView.setMinHeight(prefNumRows * Layout.LIST_ROW_HEIGHT + 28);
setPaymentAccountsCellFactory();
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"),