mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
allow for minimum application height of 708px
This commit is contained in:
parent
8f92f9ec38
commit
5e7d1d1f69
4 changed files with 39 additions and 10 deletions
|
@ -482,7 +482,7 @@ public class AppServices {
|
||||||
|
|
||||||
stage.setTitle("Sparrow");
|
stage.setTitle("Sparrow");
|
||||||
stage.setMinWidth(650);
|
stage.setMinWidth(650);
|
||||||
stage.setMinHeight(730);
|
stage.setMinHeight(708);
|
||||||
stage.setScene(scene);
|
stage.setScene(scene);
|
||||||
stage.getIcons().add(new Image(MainApp.class.getResourceAsStream("/image/sparrow-large.png")));
|
stage.getIcons().add(new Image(MainApp.class.getResourceAsStream("/image/sparrow-large.png")));
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,12 @@ public class ComboBoxTextField extends CustomTextField {
|
||||||
super();
|
super();
|
||||||
getStyleClass().add("combo-text-field");
|
getStyleClass().add("combo-text-field");
|
||||||
setupCopyButtonField(super.rightProperty());
|
setupCopyButtonField(super.rightProperty());
|
||||||
|
|
||||||
|
disabledProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
if(comboProperty.isNotNull().get()) {
|
||||||
|
comboProperty.get().setVisible(!newValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupCopyButtonField(ObjectProperty<Node> rightProperty) {
|
private void setupCopyButtonField(ObjectProperty<Node> rightProperty) {
|
||||||
|
|
|
@ -33,8 +33,11 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class TransactionDiagram extends GridPane {
|
public class TransactionDiagram extends GridPane {
|
||||||
private static final int MAX_UTXOS = 7;
|
private static final int MAX_UTXOS = 7;
|
||||||
|
private static final int REDUCED_MAX_UTXOS = MAX_UTXOS - 1;
|
||||||
private static final int MAX_PAYMENTS = 5;
|
private static final int MAX_PAYMENTS = 5;
|
||||||
private static final double DIAGRAM_HEIGHT = 215.0;
|
private static final int REDUCED_MAX_PAYMENTS = MAX_PAYMENTS - 1;
|
||||||
|
private static final double DIAGRAM_HEIGHT = 210.0;
|
||||||
|
private static final double REDUCED_DIAGRAM_HEIGHT = DIAGRAM_HEIGHT - 60;
|
||||||
private static final int TOOLTIP_SHOW_DELAY = 50;
|
private static final int TOOLTIP_SHOW_DELAY = 50;
|
||||||
|
|
||||||
private WalletTransaction walletTx;
|
private WalletTransaction walletTx;
|
||||||
|
@ -111,11 +114,12 @@ public class TransactionDiagram extends GridPane {
|
||||||
selectedUtxos.put(new PayjoinBlockTransactionHashIndex(), null);
|
selectedUtxos.put(new PayjoinBlockTransactionHashIndex(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(selectedUtxos.size() > MAX_UTXOS) {
|
int maxUtxos = getMaxUtxos();
|
||||||
|
if(selectedUtxos.size() > maxUtxos) {
|
||||||
Map<BlockTransactionHashIndex, WalletNode> utxos = new LinkedHashMap<>();
|
Map<BlockTransactionHashIndex, WalletNode> utxos = new LinkedHashMap<>();
|
||||||
List<BlockTransactionHashIndex> additional = new ArrayList<>();
|
List<BlockTransactionHashIndex> additional = new ArrayList<>();
|
||||||
for(BlockTransactionHashIndex reference : selectedUtxos.keySet()) {
|
for(BlockTransactionHashIndex reference : selectedUtxos.keySet()) {
|
||||||
if(utxos.size() < MAX_UTXOS - 1) {
|
if(utxos.size() < maxUtxos - 1) {
|
||||||
utxos.put(reference, selectedUtxos.get(reference));
|
utxos.put(reference, selectedUtxos.get(reference));
|
||||||
} else {
|
} else {
|
||||||
additional.add(reference);
|
additional.add(reference);
|
||||||
|
@ -325,11 +329,12 @@ public class TransactionDiagram extends GridPane {
|
||||||
private List<Payment> getDisplayedPayments() {
|
private List<Payment> getDisplayedPayments() {
|
||||||
List<Payment> payments = walletTx.getPayments();
|
List<Payment> payments = walletTx.getPayments();
|
||||||
|
|
||||||
if(payments.size() > MAX_PAYMENTS) {
|
int maxPayments = getMaxPayments();
|
||||||
|
if(payments.size() > maxPayments) {
|
||||||
List<Payment> displayedPayments = new ArrayList<>();
|
List<Payment> displayedPayments = new ArrayList<>();
|
||||||
List<Payment> additional = new ArrayList<>();
|
List<Payment> additional = new ArrayList<>();
|
||||||
for(Payment payment : payments) {
|
for(Payment payment : payments) {
|
||||||
if(displayedPayments.size() < MAX_PAYMENTS - 1) {
|
if(displayedPayments.size() < maxPayments - 1) {
|
||||||
displayedPayments.add(payment);
|
displayedPayments.add(payment);
|
||||||
} else {
|
} else {
|
||||||
additional.add(payment);
|
additional.add(payment);
|
||||||
|
@ -492,13 +497,33 @@ public class TransactionDiagram extends GridPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDiagramHeight() {
|
public double getDiagramHeight() {
|
||||||
if(AppServices.isReducedWindowHeight(this)) {
|
if(isReducedHeight()) {
|
||||||
return DIAGRAM_HEIGHT - 40;
|
return REDUCED_DIAGRAM_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DIAGRAM_HEIGHT;
|
return DIAGRAM_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getMaxUtxos() {
|
||||||
|
if(isReducedHeight()) {
|
||||||
|
return REDUCED_MAX_UTXOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MAX_UTXOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getMaxPayments() {
|
||||||
|
if(isReducedHeight()) {
|
||||||
|
return REDUCED_MAX_PAYMENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MAX_PAYMENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isReducedHeight() {
|
||||||
|
return !isFinal() && AppServices.isReducedWindowHeight(this);
|
||||||
|
}
|
||||||
|
|
||||||
private Node createSpacer() {
|
private Node createSpacer() {
|
||||||
final Region spacer = new Region();
|
final Region spacer = new Region();
|
||||||
VBox.setVgrow(spacer, Priority.ALWAYS);
|
VBox.setVgrow(spacer, Priority.ALWAYS);
|
||||||
|
|
|
@ -539,7 +539,6 @@ public class ServerPreferencesController extends PreferencesDetailController {
|
||||||
publicProxyHost.setDisable(!editable);
|
publicProxyHost.setDisable(!editable);
|
||||||
publicProxyPort.setDisable(!editable);
|
publicProxyPort.setDisable(!editable);
|
||||||
|
|
||||||
recentCoreServers.setVisible(editable);
|
|
||||||
coreHost.setDisable(!editable);
|
coreHost.setDisable(!editable);
|
||||||
corePort.setDisable(!editable);
|
corePort.setDisable(!editable);
|
||||||
coreAuthToggleGroup.getToggles().forEach(toggle -> ((ToggleButton)toggle).setDisable(!editable));
|
coreAuthToggleGroup.getToggles().forEach(toggle -> ((ToggleButton)toggle).setDisable(!editable));
|
||||||
|
@ -551,7 +550,6 @@ public class ServerPreferencesController extends PreferencesDetailController {
|
||||||
coreProxyHost.setDisable(!editable);
|
coreProxyHost.setDisable(!editable);
|
||||||
coreProxyPort.setDisable(!editable);
|
coreProxyPort.setDisable(!editable);
|
||||||
|
|
||||||
recentElectrumServers.setVisible(editable);
|
|
||||||
electrumHost.setDisable(!editable);
|
electrumHost.setDisable(!editable);
|
||||||
electrumPort.setDisable(!editable);
|
electrumPort.setDisable(!editable);
|
||||||
electrumUseSsl.setDisable(!editable);
|
electrumUseSsl.setDisable(!editable);
|
||||||
|
|
Loading…
Reference in a new issue