Skip to content

Commit

Permalink
Merge pull request #244 from NightRaven49/add-ui-background
Browse files Browse the repository at this point in the history
Add new background to ResultDisplay
  • Loading branch information
tjtanjin authored Mar 16, 2021
2 parents cba5fcd + 24e1cb1 commit 94081c6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/seedu/us/among/ui/ResultDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ public class ResultDisplay extends UiPart<Region> {
private ImageView loadingSpinnerPlaceholder;
@FXML
private ImageView errorPlaceholder;
@FXML
private ImageView backgroundPlaceholder;

private Timeline errorGifTimeline;

private final Image background = new Image(this.getClass().getResourceAsStream("/images/background.png"));
private final Image loadingSpinner = new Image(this.getClass().getResourceAsStream("/images/loading_spinner.gif"));
private final Image error = new Image(this.getClass().getResourceAsStream("/images/error.gif"));

Expand All @@ -43,6 +46,7 @@ public ResultDisplay() {
super(FXML);
this.loadingSpinnerPlaceholder.setImage(loadingSpinner);
this.errorPlaceholder.setImage(error);
this.backgroundPlaceholder.setImage(background);
// Set timeline for error message
this.errorGifTimeline = new Timeline(
new KeyFrame(Duration.ZERO, x -> this.getErrorPlaceholder().setVisible(true)),
Expand Down
Binary file added src/main/resources/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
-fx-background-color: derive(#1d1d1d, 30%);
}

.result-background {
-fx-opacity: 0.3;
}

.result-display {
-fx-background-color: transparent;
-fx-font-family: "Segoe UI Light";
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<?import javafx.scene.layout.HBox?>

<fx:root type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
title="imPoster" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
title="imPoster" minWidth="825" minHeight="625" onCloseRequest="#handleExit">
<icons>
<Image url="@/images/imPoster.png" />
</icons>
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/view/ResultDisplay.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<TextArea fx:id="resultDisplay" editable="false" prefHeight="3840" prefWidth="2160" styleClass="result-display" wrapText="true"/>
</VBox>
<children>
<ImageView fx:id="backgroundPlaceholder" fitHeight="450" fitWidth="450" pickOnBounds="true" preserveRatio="true" styleClass="result-background">
</ImageView>
<ImageView fx:id="loadingSpinnerPlaceholder" visible="false" fitWidth="320" fitHeight="320" preserveRatio="true" pickOnBounds="true">
</ImageView>
<ImageView fx:id="errorPlaceholder" visible="false" fitWidth="320" fitHeight="320" preserveRatio="true" pickOnBounds="true">
Expand Down

0 comments on commit 94081c6

Please sign in to comment.