Skip to content

Commit

Permalink
Update GUI styles
Browse files Browse the repository at this point in the history
  • Loading branch information
KT27Learn committed Sep 14, 2021
1 parent 359bd76 commit 29c02d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'

String javaFxVersion = '16'
String javaFxVersion = '11'

implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/duke/ui/DialogBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ private DialogBox(String text, Image img, Paint backgroundColour) {

dialog.setText(text);
displayPicture.setFill(new ImagePattern(img));
dialog.setTextFill(Color.BLACK);
dialog.setBackground(new Background(new BackgroundFill(backgroundColour, CornerRadii.EMPTY, Insets.EMPTY)));

}
Expand Down Expand Up @@ -78,7 +79,7 @@ public static DialogBox getUserDialog(String text, Image img) {
* @return DialogBox returns dialog box containing Duke image and Duke text
*/
public static DialogBox getDukeDialog(String text, Image img) {
var db = new DialogBox(text, img, Color.LIGHTGREEN);
var db = new DialogBox(text, img, Color.LIGHTBLUE);
db.flip();
return db;
}
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/view/DialogBox.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
maxWidth="1.7976931348623157E308"
prefWidth="400.0"
type="javafx.scene.layout.HBox"
xmlns="http://javafx.com/javafx/16"
xmlns="http://javafx.com/javafx/11"
xmlns:fx="http://javafx.com/fxml/1"
>
<children>
Expand All @@ -25,7 +25,10 @@
wrapText="true"
>
<font>
<Font size="15.0" />
<Font
name="Monospaced Regular"
size="15.0"
/>
</font>
<HBox.margin>
<Insets
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 @@ -7,7 +7,7 @@
<?import javafx.scene.layout.VBox?>

<!-- Background implementation reused from @jeannetoh99 -->
<AnchorPane id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="duke.ui.MainWindow">
<AnchorPane id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/11" xmlns:fx="http://javafx.com/fxml/1" fx:controller="duke.ui.MainWindow">
<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" />
Expand Down

0 comments on commit 29c02d0

Please sign in to comment.