Craig Raw
5 years ago
9 changed files with 191 additions and 52 deletions
@ -1 +1 @@ |
|||
Subproject commit 04576bddff218f284e0cf925a1f790011203eec4 |
|||
Subproject commit eb07a7ffa3c46cda83ac951d3b1ebd529460554c |
@ -0,0 +1,47 @@ |
|||
package com.sparrowwallet.sparrow.control; |
|||
|
|||
import com.sparrowwallet.drongo.wallet.Keystore; |
|||
import com.sparrowwallet.sparrow.AppController; |
|||
import javafx.application.Platform; |
|||
import javafx.scene.control.*; |
|||
import javafx.scene.layout.AnchorPane; |
|||
import javafx.scene.layout.StackPane; |
|||
|
|||
public class SeedDisplayDialog extends Dialog<Void> { |
|||
public SeedDisplayDialog(Keystore decryptedKeystore) { |
|||
final DialogPane dialogPane = getDialogPane(); |
|||
dialogPane.getStylesheets().add(AppController.class.getResource("general.css").toExternalForm()); |
|||
|
|||
int lines = decryptedKeystore.getSeed().getMnemonicCode().size() / 3; |
|||
int height = lines * 40; |
|||
|
|||
StackPane stackPane = new StackPane(); |
|||
dialogPane.setContent(stackPane); |
|||
|
|||
AnchorPane anchorPane = new AnchorPane(); |
|||
ScrollPane scrollPane = new ScrollPane(); |
|||
scrollPane.setPrefHeight(74 + height); |
|||
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); |
|||
scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); |
|||
anchorPane.getChildren().add(scrollPane); |
|||
scrollPane.setFitToWidth(true); |
|||
AnchorPane.setLeftAnchor(scrollPane, 0.0); |
|||
AnchorPane.setRightAnchor(scrollPane, 0.0); |
|||
|
|||
Accordion keystoreAccordion = new Accordion(); |
|||
scrollPane.setContent(keystoreAccordion); |
|||
|
|||
MnemonicKeystoreImportPane keystorePane = new MnemonicKeystoreImportPane(decryptedKeystore); |
|||
keystoreAccordion.getPanes().add(keystorePane); |
|||
|
|||
stackPane.getChildren().addAll(anchorPane); |
|||
|
|||
final ButtonType cancelButtonType = new javafx.scene.control.ButtonType("Cancel", ButtonBar.ButtonData.CANCEL_CLOSE); |
|||
dialogPane.getButtonTypes().addAll(cancelButtonType); |
|||
|
|||
dialogPane.setPrefWidth(500); |
|||
dialogPane.setPrefHeight(150 + height); |
|||
|
|||
Platform.runLater(() -> keystoreAccordion.setExpandedPane(keystorePane)); |
|||
} |
|||
} |
Loading…
Reference in new issue