Skip to content

Commit

Permalink
Update GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
sgn00 committed Sep 15, 2020
1 parent 4ddf5b7 commit d220440
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 4 deletions.
Binary file modified docs/Ui.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions src/main/java/duke/gui/DialogBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,24 @@ private DialogBox(String text, Image img, String type) {
}
dialog.setText(text);
if (type == DUKE) {
dialog.setStyle("-fx-text-fill: blue;");
dialog.setStyle("-fx-border-color: #ffffed ;\n"
+ "-fx-border-width: 1;\n"
+ "-fx-border-style: solid;\n"
+ "-fx-padding: 10 10 10 10;\n"
+ "-fx-background-color: #ffffed ;\n"
+ "-fx-background-radius: 5;\n"
+ "-fx-border-radius: 5;\n"
+ "-fx-text-fill: black");
}
if (text.contains("OOPS")) {
dialog.setStyle("-fx-text-fill: red;");
dialog.setStyle("-fx-border-color: #ffffed ;\n"
+ "-fx-border-width: 1;\n"
+ "-fx-border-style: solid;\n"
+ "-fx-padding: 10 10 10 10;\n"
+ "-fx-background-color: #ffffed ;\n"
+ "-fx-background-radius: 5;\n"
+ "-fx-border-radius: 5;\n"
+ "-fx-text-fill: red");
}
displayPicture.setImage(img);
}
Expand Down
Binary file modified src/main/resources/images/DaDuke.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/images/DaUser.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/images/star.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion src/main/resources/view/DialogBox.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@

<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="400.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label fx:id="dialog" text="Label" wrapText="true">
<Label fx:id="dialog" text="Label" wrapText="true"
style=" -fx-border-color: #add8e6 ;
-fx-border-width: 1;
-fx-border-style: solid;
-fx-padding: 10 10 10 10;
-fx-background-color: #add8e6 ;
-fx-background-radius: 15;
-fx-border-radius: 15;
-fx-text-fill: black;"
textFill="WHITE">
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="12.0" top="5.0" />
</HBox.margin>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
<children>
<TextField fx:id="userInput" layoutY="558.0" onAction="#handleUserInput" prefHeight="41.0" prefWidth="324.0" AnchorPane.bottomAnchor="1.0" />
<Button fx:id="sendButton" layoutX="324.0" layoutY="558.0" mnemonicParsing="false" onAction="#handleUserInput" prefHeight="41.0" prefWidth="76.0" text="Send" />
<ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="400.0" vvalue="1.0">
<ScrollPane style="-fx-background-image: url('/images/star.jpg');
-fx-background-size: 150% 150%;
-fx-background-position: bottom center;
-fx-background: transparent;" fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="400.0" vvalue="1.0">
<content>
<VBox fx:id="dialogContainer" prefHeight="552.0" prefWidth="388.0" />
</content>
Expand Down

0 comments on commit d220440

Please sign in to comment.