1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-20 10:39:19 +01:00

Simplified display of validation error display in gui

* reordered FXML elements
* removed dedicated error rows
This commit is contained in:
dpad85 2017-02-09 18:22:10 +01:00
parent ef58ef0935
commit 0b2b3ea106
4 changed files with 83 additions and 62 deletions

View File

@ -14,11 +14,14 @@
.text-error {
-fx-text-fill: rgb(216,31,74);
-fx-font-size: 11px;
-fx-translate-y: 6px;
}
.text-error.text-error-downward {
-fx-translate-y: 24px;
}
.text-error.text-error-upward {
-fx-translate-y: -6px;
-fx-translate-y: -24px;
}
.label-description {
@ -35,6 +38,10 @@
-fx-fill: rgb(93,199,254);
}
.label.text-muted {
-fx-text-fill: rgb(146,149,151);
}
/* ---------- Context Menu ---------- */
.context-menu {
@ -85,4 +92,9 @@
-fx-background-color: rgb(206,230,255);
-fx-background-insets: 0;
-fx-background-radius: 0;
}
/* ---------- Forms ----------- */
.options-separator {
-fx-translate-y: -7px;
}

View File

@ -12,26 +12,42 @@
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Separator?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="528.0"
styleClass="grid" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="258.0" minWidth="10.0" prefWidth="157.0" halignment="RIGHT" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="263.0" minWidth="10.0" prefWidth="176.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="171.0" minWidth="10.0" prefWidth="145.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="180.0" minWidth="10.0" prefWidth="180.0" halignment="RIGHT" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="180.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="160.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="1.0" prefHeight="3.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints minHeight="1.0" prefHeight="3.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints minHeight="1.0" prefHeight="3.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" minHeight="30.0" valignment="BOTTOM"/>
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="50.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField fx:id="host" prefWidth="313.0" promptText="pubkey@host:port1" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="1" />
<TextField fx:id="fundingSatoshis" prefWidth="313.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<ComboBox fx:id="unit" prefWidth="150.0" GridPane.columnIndex="2" GridPane.rowIndex="3">
<VBox alignment="CENTER_RIGHT" GridPane.rowIndex="0">
<children>
<Label styleClass="text-strong" text="Target Node URI" />
<Label styleClass="label-description" text="Address of the node" textAlignment="RIGHT" wrapText="true" />
</children>
</VBox>
<TextField fx:id="host" prefWidth="313.0" promptText="pubkey@host:port1"
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="0" />
<Label fx:id="hostError" opacity="0.0" styleClass="text-error, text-error-downward" text="Generic Invalid URI" mouseTransparent="true"
GridPane.rowIndex="0" GridPane.columnIndex="1" GridPane.columnSpan="2" />
<VBox alignment="CENTER_RIGHT" GridPane.rowIndex="1">
<children>
<Label styleClass="text-strong" text="Capacity" />
<Label styleClass="label-description" text="Funding capacity of the channel." textAlignment="RIGHT" wrapText="true" />
</children>
</VBox>
<TextField fx:id="fundingSatoshis" prefWidth="313.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<ComboBox fx:id="unit" prefWidth="150.0" GridPane.columnIndex="2" GridPane.rowIndex="1">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:id="milliBTC" fx:value="milliBTC" />
@ -40,35 +56,26 @@
</FXCollections>
</items>
</ComboBox>
<TextField fx:id="pushMsat" layoutX="193.0" layoutY="112.0" prefWidth="313.0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Button fx:id="button" defaultButton="true" mnemonicParsing="false" onAction="#handleOpen" text="Connect"
GridPane.columnIndex="1" GridPane.rowIndex="6" GridPane.valignment="BOTTOM" />
<Button cancelButton="true" mnemonicParsing="false" onAction="#handleClose" styleClass="cancel" text="Cancel"
GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="6" GridPane.valignment="BOTTOM" />
<Label fx:id="fundingSatoshisError" opacity="0.0" styleClass="text-error, text-error-downward" text="Generic Invalid Funding"
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="1" />
<Label styleClass="text-muted" text="Optional Parameters" wrapText="true" GridPane.columnIndex="0" GridPane.rowIndex="2" />
<Separator styleClass="options-separator" GridPane.columnIndex="1" GridPane.rowIndex="2" GridPane.columnSpan="2"/>
<VBox alignment="CENTER_RIGHT" GridPane.rowIndex="3">
<children>
<Label styleClass="text-strong" text="Capacity *" />
<Label styleClass="label-description" text="Funding capacity of the channel." textAlignment="RIGHT" wrapText="true" />
</children>
</VBox>
<Label fx:id="hostError" opacity="0.0" styleClass="text-error" text="Generic Invalid URI"
GridPane.columnIndex="1" GridPane.columnSpan="2" />
<Label fx:id="fundingSatoshisError" opacity="0.0" styleClass="text-error" text="Generic Invalid Funding"
GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2" />
<Label fx:id="pushMsatError" layoutX="193.0" layoutY="89.0" opacity="0.0" styleClass="text-error" text="Generic Invalid Push"
GridPane.columnIndex="1" GridPane.rowIndex="4" />
<VBox alignment="CENTER_RIGHT" layoutX="24.0" layoutY="112.0" GridPane.rowIndex="5">
<children>
<Label styleClass="text-strong" text="Push Amount" />
<Label styleClass="label-description" text="Optional amount in millisatoshi. Sent when opening channel" textAlignment="RIGHT" wrapText="true" />
</children>
</VBox>
<VBox alignment="CENTER_RIGHT" layoutX="24.0" layoutY="112.0" GridPane.rowIndex="1">
<children>
<Label styleClass="text-strong" text="Target Node URI *" />
<Label styleClass="label-description" text="Address of the node" textAlignment="RIGHT" wrapText="true" />
<Label styleClass="text-strong" text="Push Amount (mSat)" />
<Label styleClass="label-description" text="Sent when opening channel" textAlignment="RIGHT" wrapText="true" />
</children>
</VBox>
<TextField fx:id="pushMsat" prefWidth="313.0" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label fx:id="pushMsatError" opacity="0.0" styleClass="text-error, text-error-downward" text="Generic Invalid Push"
GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button fx:id="button" defaultButton="true" mnemonicParsing="false" onAction="#handleOpen" text="Connect"
GridPane.columnIndex="1" GridPane.rowIndex="4" GridPane.valignment="BOTTOM" />
<Button cancelButton="true" mnemonicParsing="false" onAction="#handleClose" styleClass="cancel" text="Cancel"
GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="4" GridPane.valignment="BOTTOM" />
</children>
<stylesheets>
<URL value="@../commons/globals.css" />

View File

@ -10,25 +10,24 @@
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<columnConstraints>
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="210.0" minWidth="10.0" prefWidth="200.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="150.0" maxWidth="150.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="120.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="120.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="1.0" prefHeight="3.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" vgrow="ALWAYS"/>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES"/>
<RowConstraints fillHeight="false" minHeight="0.0" prefHeight="1.0" valignment="CENTER" vgrow="ALWAYS"/>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES"/>
<RowConstraints fillHeight="false" minHeight="0.0" prefHeight="1.0" valignment="CENTER" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" valignment="TOP" vgrow="ALWAYS"/>
</rowConstraints>
<children>
<VBox alignment="CENTER_RIGHT" GridPane.rowIndex="1">
<VBox alignment="CENTER_RIGHT" GridPane.rowIndex="0">
<children>
<Label styleClass="text-strong" text="Amount to receive" />
<Label styleClass="label-description" wrapText="true" textAlignment="RIGHT" text="Maximum of ~0.042 BTC" />
</children>
</VBox>
<TextField fx:id="amount" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<ComboBox fx:id="unit" GridPane.columnIndex="2" GridPane.rowIndex="1" GridPane.halignment="RIGHT">
<TextField fx:id="amount" GridPane.columnIndex="1" GridPane.rowIndex="0"/>
<ComboBox fx:id="unit" GridPane.columnIndex="2" GridPane.rowIndex="0" GridPane.halignment="RIGHT">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:id="milliBTC" fx:value="milliBTC" />
@ -37,18 +36,21 @@
</FXCollections>
</items>
</ComboBox>
<Label fx:id="amountError" opacity="0.0" styleClass="text-error" text="Generic Invalid Amount"
GridPane.columnIndex="1" GridPane.columnSpan="2"/>
<Label fx:id="amountError" opacity="0.0" styleClass="text-error, text-error-downward" text="Generic Invalid Amount"
mouseTransparent="true" GridPane.rowIndex="0" GridPane.columnIndex="1" GridPane.columnSpan="2"/>
<Button defaultButton="true" mnemonicParsing="false" onAction="#handleGenerate" prefHeight="29.0"
prefWidth="95.0" text="Generate" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
prefWidth="95.0" text="Generate" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<Button cancelButton="true" mnemonicParsing="false" onAction="#handleClose" styleClass="cancel" text="Close"
GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/>
<Separator prefHeight="1.0" GridPane.columnSpan="3" GridPane.rowIndex="3"/>
GridPane.columnIndex="2" GridPane.halignment="RIGHT" GridPane.rowIndex="1"/>
<Separator prefHeight="1.0" GridPane.columnSpan="3" GridPane.rowIndex="2"/>
<Text strokeType="OUTSIDE" strokeWidth="0.0"
text="Send this Payment Request to the person owing you the amount above"
textAlignment="RIGHT" wrappingWidth="188.9560546875" GridPane.rowIndex="4"/>
textAlignment="RIGHT" wrappingWidth="188.9560546875" GridPane.rowIndex="3"/>
<TextArea fx:id="paymentRequest" editable="false" prefHeight="150.0" prefWidth="275.0" styleClass="ta"
wrapText="true" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="4"/>
wrapText="true" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3"/>
</children>
<stylesheets>
<URL value="@../commons/globals.css"/>

View File

@ -25,20 +25,20 @@
GridPane.valignment="TOP"/>
<TextArea fx:id="paymentRequest" minHeight="150.0" prefHeight="150.0" styleClass="ta" wrapText="true"
GridPane.columnSpan="2" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS"/>
<Label fx:id="paymentRequestError" opacity="0.0" text="Generic Invalid Payment Request"
GridPane.columnSpan="2" GridPane.rowIndex="2">
<styleClass>
<String fx:value="text-error"/>
<String fx:value="text-error-upward"/>
</styleClass>
</Label>
<Label fx:id="paymentRequestError" opacity="0.0" text="Generic Invalid Payment Request" mouseTransparent="true"
styleClass="text-error" GridPane.columnSpan="2" GridPane.rowIndex="2"/>
<Label styleClass="text-muted" text="Amount (mSat)" GridPane.halignment="RIGHT" GridPane.rowIndex="3"/>
<Separator GridPane.columnSpan="2" GridPane.rowIndex="6"/>
<Label styleClass="text-muted" text="Node Id" GridPane.halignment="RIGHT" GridPane.rowIndex="4"/>
<TextField fx:id="amountField" focusTraversable="false" editable="false" styleClass="noteditable" text="0" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
<Label styleClass="text-muted" text="Node Id" GridPane.halignment="RIGHT" GridPane.rowIndex="4"/>
<TextField fx:id="nodeIdField" focusTraversable="false" editable="false" styleClass="noteditable" text="N/A" GridPane.columnIndex="1" GridPane.rowIndex="4"/>
<TextField fx:id="hashField" focusTraversable="false" editable="false" styleClass="noteditable" text="N/A" GridPane.columnIndex="1" GridPane.rowIndex="5"/>
<Label styleClass="text-muted" text="hash" GridPane.halignment="RIGHT" GridPane.rowIndex="5"/>
<TextField fx:id="hashField" focusTraversable="false" editable="false" styleClass="noteditable" text="N/A" GridPane.columnIndex="1" GridPane.rowIndex="5"/>
<Separator GridPane.columnSpan="2" GridPane.rowIndex="6"/>
<Button fx:id="sendButton" defaultButton="true" mnemonicParsing="false" onAction="#handleSend" text="Send"
GridPane.rowIndex="7"/>
<Button cancelButton="true" mnemonicParsing="false" onAction="#handleClose" styleClass="cancel" text="Cancel"