Skip to content

Commit

Permalink
Improve the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaeliaaa committed Sep 13, 2020
1 parent b4115f9 commit 81b3633
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
5 changes: 0 additions & 5 deletions data/listOfTasks.txt
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
E | 0 | 7 | 2020-09-09
T | 0 | hdhd
T | 1 | yo
T | 0 | hey hey
D | 0 | yoyo | 2020-09-09
9 changes: 4 additions & 5 deletions src/main/java/duke/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ public void save(ArrayList<Task> tasks) {
File file = new File(this.path);
file.getParentFile().mkdirs();
FileWriter fw;
if (file.exists()) {
fw = new FileWriter(file, false);
} else {
fw = new FileWriter(file, true);
}
fw = file.exists()
? new FileWriter(file, false)
: new FileWriter(file, true);
for (Task task : tasks) {
fw.write(task.writeToFile() + "\n");
}
fw.close();
System.out.println("All changes had been saved.");
} catch (IOException e) {
System.err.println (e);
}
Expand Down
13 changes: 5 additions & 8 deletions src/main/resources/view/DialogBox.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.HBox?>

<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="450.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="510.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children>
<HBox fx:id="speechBubble" maxHeight="-Infinity" styleClass="speech-bubble" stylesheets="@duke.css">
<HBox fx:id="textBubble" maxHeight="-Infinity" styleClass="text-bubble" stylesheets="@duke.css">
<children>
<Label minHeight="-Infinity" fx:id="dialog" text="Label" wrapText="true">
<Label fx:id="dialog" text="Label" wrapText="true" minHeight="-Infinity" >
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
<Insets top="10.0" bottom="10.0" left="10.0" right="10.0" />
</padding>
</Label>
</children>
<HBox.margin>
<Insets left="10.0" right="10.0" />
</HBox.margin>
</HBox>
<ImageView fx:id="displayPicture" fitHeight="99.0" fitWidth="99.0" pickOnBounds="true" preserveRatio="true" />
</children>
<padding>
<Insets bottom="15.0" left="5.0" right="5.0" top="15.0" />
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</padding>
</fx:root>
5 changes: 4 additions & 1 deletion src/main/resources/view/duke.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
-fx-background-size: cover;
}

.speech-bubble {
.text-bubble {
-fx-background-color: #F5F5F5;
-fx-background-radius: 15px;
-fx-border-color: black;
-fx-border-width: 2 2 2 2;
-fx-border-radius: 15px;
}

0 comments on commit 81b3633

Please sign in to comment.