Skip to content

Commit 6c68a23

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#75 from khor-jingqian/change-design
Change layout and enable assertions in gradle file
2 parents 5275d7d + aebdf38 commit 6c68a23

6 files changed

Lines changed: 80 additions & 12 deletions

File tree

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,8 @@ shadowJar {
6969
archiveName = 'addressbook.jar'
7070
}
7171

72+
run {
73+
enableAssertions = true
74+
}
75+
7276
defaultTasks 'clean', 'test'

src/main/java/seedu/address/ui/MainWindow.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
import javafx.event.ActionEvent;
66
import javafx.fxml.FXML;
7+
import javafx.geometry.Insets;
78
import javafx.scene.control.MenuItem;
89
import javafx.scene.control.TextInputControl;
910
import javafx.scene.input.KeyCombination;
1011
import javafx.scene.input.KeyEvent;
12+
import javafx.scene.layout.Background;
13+
import javafx.scene.layout.BackgroundFill;
14+
import javafx.scene.layout.CornerRadii;
1115
import javafx.scene.layout.StackPane;
16+
import javafx.scene.paint.Color;
1217
import javafx.stage.Stage;
1318
import seedu.address.commons.core.GuiSettings;
1419
import seedu.address.commons.core.LogsCenter;
@@ -140,6 +145,8 @@ void fillInnerParts() {
140145
CommandBox commandBox = new CommandBox(this::executeCommand);
141146
commandBoxPlaceholder.getChildren().add(commandBox.getRoot());
142147

148+
routineListPanelPlaceholder.setBackground(new Background(new BackgroundFill(Color.YELLOW, CornerRadii.EMPTY,
149+
Insets.EMPTY)));
143150
routineListPanel = new RoutineListPanel(logic.getFilteredRoutineList());
144151
routineListPanelPlaceholder.getChildren().add(routineListPanel.getRoot());
145152
}

src/main/resources/view/DarkTheme.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@
116116
-fx-border-width: 1;
117117
}
118118

119+
.list-cell:filled:selected #routineCardPane {
120+
-fx-border-color: #4b7b91;
121+
-fx-border-width: 1;
122+
}
123+
119124
.list-cell .label {
120125
-fx-text-fill: white;
121126
}
@@ -312,6 +317,35 @@
312317
-fx-border-width: 0;
313318
}
314319

320+
#routineCardPane {
321+
-fx-background-color: transparent;
322+
-fx-border-width: 0;
323+
}
324+
325+
#timetable {
326+
-fx-background-color: #FFF000;
327+
}
328+
329+
#calories {
330+
-fx-background-color: #000FFF;
331+
}
332+
333+
#sideBox {
334+
-fx-background-color: #FF7F50;
335+
}
336+
337+
#bmi {
338+
-fx-background-color: #ADD8E6;
339+
}
340+
341+
#logo {
342+
-fx-background-color: #FFF123;
343+
}
344+
345+
#routineListPanel {
346+
-fx-background-color: #FFFFFF;
347+
}
348+
315349
#commandTypeLabel {
316350
-fx-font-size: 11px;
317351
-fx-text-fill: #F70D1A;

src/main/resources/view/MainWindow.fxml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,31 @@
2828
<MenuItem fx:id="helpMenuItem" mnemonicParsing="false" onAction="#handleHelp" text="Help" />
2929
</Menu>
3030
</MenuBar>
31+
<HBox prefHeight="200" prefWidth="250" id="timetable">
3132

32-
<StackPane fx:id="commandBoxPlaceholder" styleClass="pane-with-border" VBox.vgrow="NEVER">
33-
<padding>
34-
<Insets bottom="5" left="10" right="10" top="5" />
35-
</padding>
36-
</StackPane>
33+
</HBox>
34+
35+
<HBox>
36+
<children>
37+
<HBox prefHeight="200" prefWidth="610" id="calories">
38+
39+
</HBox>
40+
<VBox prefHeight="200" prefWidth="610">
41+
<HBox prefHeight="100" prefWidth="610" id="sideBox">
42+
43+
</HBox>
44+
<HBox prefHeight="100" prefWidth="610">
45+
<VBox prefHeight="100" prefWidth="305" id="bmi">
46+
47+
</VBox>
48+
<VBox prefHeight="100" prefWidth="305" id = "logo" >
49+
50+
</VBox>
51+
</HBox>
52+
</VBox>
53+
</children>
54+
</HBox>
3755

38-
<StackPane fx:id="resultDisplayPlaceholder" maxHeight="100" minHeight="100" prefHeight="100" styleClass="pane-with-border" VBox.vgrow="NEVER">
39-
<padding>
40-
<Insets bottom="5" left="10" right="10" top="5" />
41-
</padding>
42-
</StackPane>
4356
<HBox prefHeight="350.0" prefWidth="200.0">
4457
<children>
4558

@@ -72,6 +85,16 @@
7285
</VBox>
7386
</children>
7487
</HBox>
88+
<StackPane fx:id="resultDisplayPlaceholder" maxHeight="100" minHeight="100" prefHeight="100" styleClass="pane-with-border" VBox.vgrow="NEVER">
89+
<padding>
90+
<Insets bottom="5" left="10" right="10" top="5" />
91+
</padding>
92+
</StackPane>
93+
<StackPane fx:id="commandBoxPlaceholder" styleClass="pane-with-border" VBox.vgrow="NEVER">
94+
<padding>
95+
<Insets bottom="5" left="10" right="10" top="5" />
96+
</padding>
97+
</StackPane>
7598

7699
<StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
77100
</VBox>

src/main/resources/view/RoutineListCard.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<?import javafx.scene.layout.Region?>
1010
<?import javafx.scene.layout.VBox?>
1111

12-
<HBox id="cardPane" fx:id="cardPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
12+
<HBox id="routineCardPane" fx:id="routineCardPane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
1313
<GridPane HBox.hgrow="ALWAYS">
1414
<columnConstraints>
1515
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150" />

src/main/resources/view/RoutineListPanel.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<?import javafx.scene.control.ListView?>
44
<?import javafx.scene.layout.VBox?>
55

6-
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
6+
<VBox id="routineListPanel" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
77
<ListView fx:id="routineListView" VBox.vgrow="ALWAYS" />
88
</VBox>

0 commit comments

Comments
 (0)