fix receive pane layout

This commit is contained in:
Craig Raw 2020-08-07 17:10:32 +02:00
parent 84d08fea18
commit b43b25769e
3 changed files with 9 additions and 7 deletions

View file

@ -2,6 +2,7 @@ package com.sparrowwallet.sparrow.wallet;
import com.google.common.eventbus.Subscribe; import com.google.common.eventbus.Subscribe;
import com.google.zxing.BarcodeFormat; import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.client.j2se.MatrixToImageConfig; import com.google.zxing.client.j2se.MatrixToImageConfig;
import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix; import com.google.zxing.common.BitMatrix;
@ -43,6 +44,7 @@ import java.net.URL;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -163,7 +165,7 @@ public class ReceiveController extends WalletFormController implements Initializ
private Image getQrCode(String address) { private Image getQrCode(String address) {
try { try {
QRCodeWriter qrCodeWriter = new QRCodeWriter(); QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix qrMatrix = qrCodeWriter.encode(address, BarcodeFormat.QR_CODE, 150, 150); BitMatrix qrMatrix = qrCodeWriter.encode(address, BarcodeFormat.QR_CODE, 130, 130, Map.of(EncodeHintType.MARGIN, 2));
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
MatrixToImageWriter.writeToStream(qrMatrix, "PNG", baos, new MatrixToImageConfig()); MatrixToImageWriter.writeToStream(qrMatrix, "PNG", baos, new MatrixToImageConfig());

View file

@ -11,6 +11,6 @@
-fx-padding: 20; -fx-padding: 20;
} }
#lastUsedField .input-container { #lastUsedField .input-container, #derivationField .input-container {
-fx-alignment: center-left; -fx-alignment: center-left;
} }

View file

@ -26,21 +26,21 @@
<Insets left="25.0" right="25.0" top="25.0" /> <Insets left="25.0" right="25.0" top="25.0" />
</padding> </padding>
<columnConstraints> <columnConstraints>
<ColumnConstraints percentWidth="80" /> <ColumnConstraints prefWidth="620" />
<ColumnConstraints percentWidth="20" /> <ColumnConstraints prefWidth="150" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints /> <RowConstraints />
</rowConstraints> </rowConstraints>
<Form GridPane.columnIndex="0" GridPane.rowIndex="0"> <Form GridPane.columnIndex="0" GridPane.rowIndex="0">
<Fieldset inputGrow="SOMETIMES" text="Receive"> <Fieldset inputGrow="ALWAYS" text="Receive">
<Field text="Address:"> <Field text="Address:">
<CopyableTextField fx:id="address" styleClass="address-text-field" editable="false"/> <CopyableTextField fx:id="address" styleClass="address-text-field" editable="false"/>
</Field> </Field>
<Field text="Label:"> <Field text="Label:">
<TextField fx:id="label" /> <TextField fx:id="label" />
</Field> </Field>
<Field text="Derivation:"> <Field fx:id="derivationField" text="Derivation:">
<CopyableLabel fx:id="derivationPath" /> <CopyableLabel fx:id="derivationPath" />
</Field> </Field>
<Field fx:id="lastUsedField" text="Last Used:"> <Field fx:id="lastUsedField" text="Last Used:">
@ -72,7 +72,7 @@
<Field text="Descriptor:"> <Field text="Descriptor:">
<VirtualizedScrollPane> <VirtualizedScrollPane>
<content> <content>
<CodeArea fx:id="outputDescriptor" editable="false" wrapText="true" prefHeight="42" maxHeight="42" styleClass="uneditable-codearea" /> <CodeArea fx:id="outputDescriptor" editable="false" wrapText="true" prefHeight="63" maxHeight="63" styleClass="uneditable-codearea" />
</content> </content>
</VirtualizedScrollPane> </VirtualizedScrollPane>
</Field> </Field>