Browse Source

set tx hex divider lower when window height is reduced

terminal
Craig Raw 4 years ago
parent
commit
650c3657a5
  1. 5
      src/main/java/com/sparrowwallet/sparrow/AppServices.java
  2. 6
      src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java
  3. 2
      src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java

5
src/main/java/com/sparrowwallet/sparrow/AppServices.java

@ -21,6 +21,7 @@ import javafx.beans.value.ObservableValue;
import javafx.concurrent.ScheduledService;
import javafx.concurrent.Worker;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
@ -278,6 +279,10 @@ public class AppServices {
}
}
public static boolean isReducedWindowHeight(Node node) {
return (node.getScene() != null && node.getScene().getWindow().getHeight() < 768);
}
public MainApp getApplication() {
return application;
}

6
src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java

@ -408,17 +408,13 @@ public class TransactionDiagram extends GridPane {
}
public double getDiagramHeight() {
if(isReducedHeight()) {
if(AppServices.isReducedWindowHeight(this)) {
return DIAGRAM_HEIGHT - 40;
}
return DIAGRAM_HEIGHT;
}
private boolean isReducedHeight() {
return (this.getScene() != null && this.getScene().getWindow().getHeight() < 768);
}
private Node createSpacer() {
final Region spacer = new Region();
VBox.setVgrow(spacer, Priority.ALWAYS);

2
src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java

@ -76,6 +76,8 @@ public class TransactionController implements Initializable {
} else if(TransactionView.OUTPUT.equals(initialView) && initialIndex >= PageForm.PAGE_SIZE) {
fetchOutputBlockTransactions(initialIndex, initialIndex + 1);
}
Platform.runLater(() -> transactionMasterDetail.setDividerPosition(AppServices.isReducedWindowHeight(transactionMasterDetail) ? 0.9 : 0.82));
}
private void initializeTxTree() {

Loading…
Cancel
Save