Skip to content

Commit

Permalink
Refactor: GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
yumengtan committed Mar 31, 2022
1 parent 09deea7 commit 517069e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 55 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/commons/core/GuiSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class GuiSettings implements Serializable {

private static final double DEFAULT_HEIGHT = 600;
private static final double DEFAULT_WIDTH = 740;
private static final double DEFAULT_WIDTH = 800;

private final double windowWidth;
private final double windowHeight;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/ui/UiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void showAlertDialogAndWait(Alert.AlertType type, String title, String headerTex
private static void showAlertDialogAndWait(Stage owner, AlertType type, String title, String headerText,
String contentText) {
final Alert alert = new Alert(type);
alert.getDialogPane().getStylesheets().add("view/DarkTheme.css");
alert.getDialogPane().getStylesheets().add("view/ThemePresets.css");
alert.initOwner(owner);
alert.setTitle(title);
alert.setHeaderText(headerText);
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/view/CommandBox.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.StackPane?>

<StackPane styleClass="stack-pane" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<TextField fx:id="commandTextField" onAction="#handleCommandEntered" promptText="Enter command here..."/>
<StackPane style="-fx-border-radius: 15;" styleClass="stack-pane" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<TextField fx:id="commandTextField" onAction="#handleCommandEntered" promptText="Enter command here..." style="-fx-border-radius: 15; -fx-border-color: #000000;" />
</StackPane>

3 changes: 2 additions & 1 deletion src/main/resources/view/HelpWindow.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#copyButton, #helpMessage {
-fx-text-fill: white;
-fx-font-family: "Verdana";
}

#copyButton {
Expand All @@ -15,5 +16,5 @@
}

#helpMessageContainer {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-background-color: derive(#1d1d1d, -10%);
}
38 changes: 21 additions & 17 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>

<fx:root minHeight="600" minWidth="450" onCloseRequest="#handleExit" title="NUScheduler" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<fx:root minHeight="600.0" minWidth="400.0" onCloseRequest="#handleExit" title="NUScheduler" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/address_book_32.png" />
</icons>
<scene>
<Scene>
<stylesheets>
<URL value="@DarkTheme.css" />
<URL value="@ThemePresets.css" />
<URL value="@Extensions.css" />
</stylesheets>

<VBox>
<MenuBar fx:id="menuBar" VBox.vgrow="NEVER">
<VBox style="-fx-background-color: #fffff0;">
<MenuBar fx:id="menuBar" style="-fx-background-color: #c9f1fd;" VBox.vgrow="NEVER">
<Menu mnemonicParsing="false" text="File">
<MenuItem mnemonicParsing="false" onAction="#handleExit" text="Exit" />
</Menu>
Expand All @@ -32,31 +33,34 @@
</Menu>
</MenuBar>

<StackPane fx:id="commandBoxPlaceholder" styleClass="pane-with-border" VBox.vgrow="NEVER">
<padding>
<Insets bottom="5" left="10" right="10" top="5" />
</padding>
</StackPane>

<StackPane fx:id="resultDisplayPlaceholder" maxHeight="100" minHeight="100" prefHeight="100" styleClass="pane-with-border" VBox.vgrow="NEVER">
<padding>
<Insets bottom="5" left="10" right="10" top="5" />
</padding>
</StackPane>

<SplitPane dividerPositions="0.5" VBox.vgrow="ALWAYS" style="-fx-background-color: #fffff0;">
<VBox fx:id="personList" minWidth="340" prefWidth="340" styleClass="pane-with-border" VBox.vgrow="ALWAYS">
<padding>
<Insets bottom="10" left="10" right="10" top="10" />
</padding>
<StackPane fx:id="personListPanelPlaceholder" VBox.vgrow="ALWAYS" />

</VBox>

<VBox fx:id="taskList" minWidth="340" prefWidth="340" styleClass="pane-with-border" VBox.vgrow="ALWAYS">
<padding>
<Insets bottom="10" left="10" right="10" top="10" />
</padding>
<StackPane fx:id="taskListPanelPlaceholder" VBox.vgrow="ALWAYS" />
</VBox>
</SplitPane>

<StackPane fx:id="resultDisplayPlaceholder" maxHeight="200" minHeight="100" prefHeight="100" styleClass="pane-with-border" VBox.vgrow="ALWAYS">
<padding>
<Insets bottom="5" left="10" right="10" top="5" />
</padding>
</StackPane>

<StackPane fx:id="commandBoxPlaceholder" styleClass="pane-with-border" VBox.vgrow="NEVER">
<padding>
<Insets bottom="5" left="10" right="10" top="5" />
</padding>
</StackPane>

<StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
</VBox>
</Scene>
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/view/TaskCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<HBox spacing="5" alignment="CENTER_LEFT">
<Label fx:id="taskId" styleClass="cell_big_label">
<minWidth>
<!-- Ensures that the label text is never truncated -->
<Region fx:constant="USE_PREF_SIZE" />
</minWidth>
</Label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.background {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-background-color: derive(#fffff0, 20%);
background-color: #383838; /* Used in the default.html file */
}

Expand Down Expand Up @@ -40,9 +40,9 @@
}

.table-view {
-fx-base: #1d1d1d;
-fx-control-inner-background: #1d1d1d;
-fx-background-color: #1d1d1d;
-fx-base: #f0ffff;
-fx-control-inner-background: #f0ffff;
-fx-background-color: #f0ffff;
-fx-table-cell-border-color: transparent;
-fx-table-header-border-color: transparent;
-fx-padding: 5;
Expand Down Expand Up @@ -77,47 +77,50 @@
}

.split-pane:horizontal .split-pane-divider {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-border-color: transparent transparent transparent #4d4d4d;
-fx-background-color: derive(#f0ffff, 20%);
-fx-border-color: derive(#f0ffff, 20%);
}

.split-pane {
-fx-border-radius: 1;
-fx-border-width: 1;
-fx-background-color: derive(#1d1d1d, 20%);
-fx-background-color: derive(#f0ffff, 20%);
}

.list-view {
-fx-background-insets: 0;
-fx-padding: 0;
-fx-background-color: derive(#1d1d1d, 20%);
-fx-background-color: derive(#f0ffff, 20%);
}

.list-cell {
-fx-label-padding: 0 0 0 0;
-fx-graphic-text-gap : 0;
-fx-padding: 0 0 0 0;
-fx-background-insets: 3px;
-fx-background-radius: 15;
}

.list-cell:filled:even {
-fx-background-color: #3c3e3f;
-fx-background-color: #e8eaf6;
}

.list-cell:filled:odd {
-fx-background-color: #515658;
-fx-background-color: #dadef1;
}

.list-cell:filled:selected {
-fx-background-color: #424d5f;
-fx-background-color: #d2d4e0;
}

.list-cell:filled:selected #cardPane {
-fx-label-padding: 0 0 0 0;
-fx-border-color: #3e7b91;
-fx-border-width: 1;
-fx-background-insets: 3px;
-fx-border-radius: 15;
}

.list-cell .label {
-fx-text-fill: white;
-fx-text-fill: black;
}

.cell_big_label {
Expand All @@ -133,24 +136,25 @@
}

.stack-pane {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-background-color: derive(#f0ffff, 20%);
-fx-border-color: derive(#1d1d1d, 40%);
}

.pane-with-border {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-border-color: derive(#1d1d1d, 10%);
-fx-background-color: derive(#fffff0, 20%);
-fx-border-color: derive(#1d1d1d, -10%);
-fx-border-top-width: 1px;
}

.status-bar {
-fx-background-color: derive(#1d1d1d, 30%);
-fx-background-color: #c9f1fd;
}

.result-display {
-fx-background-color: transparent;
-fx-background-color: derive(#fffff0, 20%);
-fx-font-family: "Segoe UI Light";
-fx-font-size: 13pt;
-fx-text-fill: white;
-fx-text-fill: black;
}

.result-display .label {
Expand All @@ -159,7 +163,7 @@

.status-bar .label {
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-text-fill: black;
-fx-padding: 4px;
-fx-pref-height: 30px;
}
Expand All @@ -181,11 +185,11 @@
}

.grid-pane .stack-pane {
-fx-background-color: derive(#1d1d1d, 30%);
-fx-background-color: derive(#fffff0, 30%);
}

.context-menu {
-fx-background-color: derive(#1d1d1d, 50%);
-fx-background-color: derive(#fffff0, 30%);
}

.context-menu .label {
Expand All @@ -199,14 +203,24 @@
.menu-bar .label {
-fx-font-size: 14pt;
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-text-fill: black;
-fx-opacity: 0.9;
}

.menu .left-container {
-fx-background-color: black;
-fx-background-color: #c9f1fd;
}

.menu-item .label{
-fx-background-color: #c9f1fd;
-fx-text-fill: black;
}

.context-menu {
-fx-background-color: #c9f1fd;
-fx-border-color: #1d1d1d;
-fx-border-width: 1;
}
/*
* Metro style Push Button
* Author: Pedro Duque Vieira
Expand Down Expand Up @@ -267,11 +281,11 @@
.dialog-pane > *.label.content {
-fx-font-size: 14px;
-fx-font-weight: bold;
-fx-text-fill: white;
-fx-text-fill: black;
}

.dialog-pane:header *.header-panel {
-fx-background-color: derive(#1d1d1d, 25%);
-fx-background-color: derive(#f0ffff, 20%);
}

.dialog-pane:header *.header-panel *.label {
Expand All @@ -282,12 +296,15 @@
}

.scroll-bar {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-background-color: derive(#e6e6e7, 20%);
}

.scroll-bar .thumb {
-fx-background-color: derive(#1d1d1d, 50%);
-fx-background-color: #e6e6e7;
-fx-background-insets: 3;
-fx-border-color: #2d4b5a;
-fx-background-radius : 1em;
-fx-border-radius: 1em;
}

.scroll-bar .increment-button, .scroll-bar .decrement-button {
Expand Down Expand Up @@ -318,22 +335,23 @@
}

#commandTextField {
-fx-prompt-text-fill: black;
-fx-background-color: transparent #383838 transparent #383838;
-fx-background-insets: 0;
-fx-border-color: #383838 #383838 #ffffff #383838;
-fx-border-insets: 0;
-fx-border-width: 1;
-fx-font-family: "Segoe UI Light";
-fx-font-size: 13pt;
-fx-text-fill: white;
-fx-text-fill: black;
}

#filterField, #personListPanel, #personWebpage {
-fx-effect: innershadow(gaussian, black, 10, 0, 0, 0);
}

#resultDisplay .content {
-fx-background-color: transparent, #383838, transparent, #383838;
-fx-background-color: derive(#f0ffff, 20%);
-fx-background-radius: 0;
}

Expand Down

0 comments on commit 517069e

Please sign in to comment.