mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-23 14:40:34 +01:00
Improved look of error message in splash window
This commit is contained in:
parent
e12e5316cf
commit
e6a262a4b0
6 changed files with 53 additions and 11 deletions
|
@ -55,11 +55,16 @@
|
|||
.button.cancel:pressed .text {
|
||||
-fx-fill: rgb(191,68,92);
|
||||
}
|
||||
|
||||
.pretty-line-bottom {
|
||||
|
||||
.button.grey {
|
||||
-fx-background-color: rgb(230,230,230);
|
||||
}
|
||||
.button.grey:hover,
|
||||
.button.grey:pressed {
|
||||
-fx-background-color: rgb(220,220,220);
|
||||
}
|
||||
.button.grey .text {
|
||||
-fx-fill: rgb(95,95,95);
|
||||
}
|
||||
|
||||
.text-strong {
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
|
BIN
eclair-node/src/main/resources/gui/commons/images/warning.png
Normal file
BIN
eclair-node/src/main/resources/gui/commons/images/warning.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 728 B |
|
@ -3,7 +3,13 @@
|
|||
}
|
||||
|
||||
.label.splash-error-label {
|
||||
-fx-background-color: rgb(75,75,75);
|
||||
-fx-text-fill: white;
|
||||
-fx-padding: .5em 1em;
|
||||
-fx-padding: .25em;
|
||||
}
|
||||
|
||||
.error-box {
|
||||
-fx-background-color: rgb(255,255,255);
|
||||
-fx-text-fill: white;
|
||||
-fx-padding: 2em;
|
||||
-fx-border-color: rgb(180,180,180);
|
||||
-fx-border-width: 1px;
|
||||
}
|
|
@ -1,12 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import java.lang.String?>
|
||||
<?import java.net.URL?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.effect.BoxBlur?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<Pane fx:id="splash" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="457.0" prefWidth="760.0" styleClass="transparent" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.acinq.eclair.gui.controllers.SplashController">
|
||||
|
@ -24,10 +29,33 @@
|
|||
<Image url="@../commons/images/eclair01-icon.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<VBox fx:id="errorBox" alignment="TOP_RIGHT" layoutX="142.0" layoutY="211.0" opacity="0.0" prefHeight="68.0" prefWidth="370.0">
|
||||
<VBox fx:id="errorBox" alignment="CENTER" layoutX="195.0" layoutY="71.0" opacity="0.0" prefWidth="370.0" styleClass="error-box">
|
||||
<children>
|
||||
<Label fx:id="errorLabel" styleClass="splash-error-label" text="An error has occured!" />
|
||||
<Button fx:id="closeButton" mnemonicParsing="false" onAction="#closeAndKill" styleClass="close" text="Close" />
|
||||
<GridPane hgap="10.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="40.0" prefWidth="40.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="45.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="RIGHT">
|
||||
<image>
|
||||
<Image url="@../commons/images/warning.png" />
|
||||
</image>
|
||||
</ImageView>
|
||||
<Label fx:id="errorLabel" text="An error has occured!" wrapText="true" GridPane.columnIndex="1" />
|
||||
</children>
|
||||
<VBox.margin>
|
||||
<Insets bottom="40.0" />
|
||||
</VBox.margin>
|
||||
</GridPane>
|
||||
<Button fx:id="closeButton" mnemonicParsing="false" onAction="#closeAndKill" text="Close">
|
||||
<styleClass>
|
||||
<String fx:value="button" />
|
||||
<String fx:value="grey" />
|
||||
</styleClass></Button>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
|
|
|
@ -14,9 +14,9 @@ import grizzled.slf4j.Logging
|
|||
*/
|
||||
class SplashController extends Logging {
|
||||
|
||||
@FXML var splash: Pane = _
|
||||
@FXML var img: ImageView = _
|
||||
@FXML var imgBlurred: ImageView = _
|
||||
@FXML var splash: Pane = _
|
||||
@FXML var errorLabel: Label = _
|
||||
@FXML var closeButton: Button = _
|
||||
@FXML var errorBox: VBox = _
|
||||
|
@ -43,6 +43,8 @@ class SplashController extends Logging {
|
|||
}
|
||||
|
||||
def showError(message: String): Unit = {
|
||||
img.setOpacity(0)
|
||||
imgBlurred.setOpacity(0)
|
||||
errorLabel.setText(message)
|
||||
errorBox.setOpacity(1)
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ class SplashStage() extends Stage() {
|
|||
initModality(Modality.WINDOW_MODAL)
|
||||
initStyle(StageStyle.TRANSPARENT)
|
||||
setResizable(false)
|
||||
|
||||
val icon = new Image("/gui/commons/images/eclair02.png", false)
|
||||
this.getIcons().add(icon)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue