Skip to content

Commit

Permalink
Merge pull request #111 from vig42/master
Browse files Browse the repository at this point in the history
Modify GUI
  • Loading branch information
pangjiahao authored Nov 7, 2018
2 parents a203c15 + 93255a0 commit 2617d9e
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 62 deletions.
Binary file modified docs/images/Ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/commons/core/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
public class Messages {

public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command.\nEnter 'help' to see the list of commands.";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_CALENDAR_EVENTS_DISPLAYED_INDEX = "The calendar event index provided "
+ "is invalid";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public abstract class Command {
public static final String MESSAGE_INCORRECT_MODEL_TODO =
"Incorrect Model: To Do Commands should operate on the ModelTodo";
public static final String MESSAGE_INCORRECT_MODEL_CALENDAR =
"Incorrect Model: Calendar Commands should operate on the ModelTodo";
"Incorrect Model: Calendar Commands should operate on the Model";

protected boolean isToDoCommand;

Expand Down
18 changes: 0 additions & 18 deletions src/main/java/seedu/address/logic/parser/SchedulerParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@ public class SchedulerParser {
private static final Pattern BASIC_COMMAND_FORMAT = Pattern.compile("(?<commandWord>(\\w+\\s?(?!\\w/|[0-9])){1,2})"
+ "(?<arguments>.*)");

/**
* Parses user input, returns true if user input corresponds to a todolist command
*
* @param userInput full user input string
* @return whether user input corresponds to a todolist command
* @throws ParseException if the user input does not conform the expected format
*/
public boolean isToDoCommand(String userInput) throws ParseException {
final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());
if (!matcher.matches()) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));
}

final String commandWord = matcher.group("commandWord").trim();

return commandWord.contains("todo");
}

/**
* Parses user input into command for execution.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String toInputFormat() {

@Override
public String toString() {
return localDateTime.format(DateTimeFormatter.ofPattern("dd MMM yyyy hh:mm a"));
return localDateTime.format(DateTimeFormatter.ofPattern("E, dd MMM yyyy hh:mm a"));
}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/seedu/address/ui/CalendarEventCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class CalendarEventCard extends UiPart<Region> {
@FXML
private Label id;
@FXML
private Label start;
@FXML
private Label end;
@FXML
private Label description;
@FXML
private Label venue;
Expand All @@ -42,9 +46,10 @@ public CalendarEventCard(CalendarEvent calendarEvent, int displayedIndex) {
this.calendarEvent = calendarEvent;
id.setText(displayedIndex + ". ");
title.setText(calendarEvent.getTitle().value);
start.setText("Start: " + calendarEvent.getStart().toString());
end.setText("End: " + calendarEvent.getEnd().toString());
description.setText(calendarEvent.getDescriptionObject().value);
venue.setText(calendarEvent.getVenue().value);
// TODO add start date and end date (remember to update fxml file)
calendarEvent.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
}

Expand Down
Binary file modified src/main/resources/images/calendar.png
Loading
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/calendar_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/main/resources/view/CalendarEventCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<Label fx:id="title" text="\$first" styleClass="cell_big_label"/>
</HBox>
<FlowPane fx:id="tags"/>
<Label fx:id="start" styleClass="cell_small_label" text="\$start"/>
<Label fx:id="end" styleClass="cell_small_label" text="\$end"/>
<Label fx:id="description" styleClass="cell_small_label" text="\$description"/>
<Label fx:id="venue" styleClass="cell_small_label" text="\$venue"/>
</VBox>
Expand Down
149 changes: 122 additions & 27 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,38 @@
}

/* tab styles */
.tab-label {
-fx-font-family: "Segoe UI";
-fx-font-size: 12;
-fx-alignment: CENTER;
-fx-font-weight: bold;
.tab-header-background {
-fx-background-color: #282828;
}

.tab {
-fx-background-insets: 0 1 0 1,0,0;
.tab-pane:top *.tab-header-area {
-fx-padding: 0em 0em 0em 0em;
}

.tab-pane {
-fx-tab-min-width:90px;
.tab-pane:bottom *.tab-header-area {
-fx-padding: 0em 0em 0em 0em;
}

.tab-header-background {
-fx-background-color: #3c3c3c
.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
-fx-background-color: transparent;
-fx-border-color: transparent;
}

.tab-pane .tab {
-fx-background-color: #282828;
-fx-border-color: #282828;
}

.tab-pane .tab:selected {
-fx-background-color: #3c3e3f;
-fx-border-color: #3c3e3f;
}

.tab-label {
-fx-font-family: "Segoe UI";
-fx-font-size: 14;
-fx-alignment: CENTER;
-fx-text-fill: #CCCCCC;
}


Expand Down Expand Up @@ -69,6 +84,8 @@
-fx-border-radius: 10;
}


/* calendar styles */
#monthYearPanelPlaceholder {
-fx-background-color: #282828;
}
Expand All @@ -94,37 +111,85 @@
-fx-width: 3;
}

/* calendar styles */
#calendarPanelPlaceHolder {
#calendarDisplayBox {
-fx-background-color: #282828;
}

#filterField, #CalendarEventListPanel, #calendarEventWebpage {
-fx-effect: innershadow(gaussian, black, 10, 0, 0, 0);
-fx-background-color: #282828;

/* dark theme for todolist and search pane items */
.list-view {
-fx-background-insets: 0;
-fx-padding: 0;
-fx-background-color: derive(#1d1d1d, 20%);
}

#calendarEventListPanelPlaceholder {
-fx-background-color: #282828;
.list-cell {
-fx-label-padding: 0 0 0 0;
-fx-graphic-text-gap : 0;
-fx-padding: 0 0 0 0;
}

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

#cardPane {
-fx-background-color: transparent;
-fx-border-width: 0;
.list-cell:filled:odd {
-fx-background-color: #515658;
}

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

#calendarDisplayBox {
-fx-background-color: #282828;
.list-cell:filled:selected #cardPane {
-fx-border-color: #3e7b91;
-fx-border-width: 1;
}

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

.cell_big_label {
-fx-font-family: "Segoe UI Semibold";
-fx-font-size: 16px;
-fx-text-fill: #010504;
}

.cell_small_label {
-fx-font-family: "Segoe UI";
-fx-font-size: 13px;
-fx-text-fill: #010504;
}


/* font for todolist panel */
.label {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
-fx-text-fill: #555555;
-fx-opacity: 0.9;
}

.label-bright {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
-fx-text-fill: white;
-fx-opacity: 1;
}

.label-header {
-fx-font-size: 32pt;
-fx-font-family: "Segoe UI Light";
-fx-text-fill: white;
-fx-opacity: 1;
}

#priority {
-fx-alignment: CENTER;
}


/* command box styles */
#commandTypeLabel {
-fx-font-size: 11px;
Expand Down Expand Up @@ -173,6 +238,7 @@
-fx-text-fill: black !important;
}


/* tags styles */
#tags {
-fx-hgap: 7;
Expand All @@ -188,6 +254,7 @@
-fx-font-size: 11;
}


/* alert box */
.dialog-pane {
-fx-background-color: #1d1d1d;
Expand All @@ -214,3 +281,31 @@
-fx-text-fill: white;
}


/* dark scroll bar for todolist */
/* todo use this scrollbar style for the calendar too, it looks really nice */
.scroll-bar {
-fx-background-color: derive(#1d1d1d, 20%);
}

.scroll-bar .thumb {
-fx-background-color: derive(#1d1d1d, 50%);
-fx-background-insets: 3;
}

.scroll-bar .increment-button, .scroll-bar .decrement-button {
-fx-background-color: transparent;
-fx-padding: 0 0 0 0;
}

.scroll-bar .increment-arrow, .scroll-bar .decrement-arrow {
-fx-shape: " ";
}

.scroll-bar:vertical .increment-arrow, .scroll-bar:vertical .decrement-arrow {
-fx-padding: 1 8 1 8;
}

.scroll-bar:horizontal .increment-arrow, .scroll-bar:horizontal .decrement-arrow {
-fx-padding: 8 1 8 1;
}
12 changes: 0 additions & 12 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,11 @@
<TabPane fx:id="tabPane" tabClosingPolicy="UNAVAILABLE">
<Tab text="To Do List">
<VBox prefHeight="675.0" prefWidth="300.0">
<Label fx:id="taskListHeader" maxWidth="1.7976931348623157E308" minHeight="25.0" text="Tasks"
VBox.vgrow="ALWAYS">
<padding>
<Insets left="5.0"/>
</padding>
</Label>
<StackPane fx:id="taskListPanelPlaceholder" VBox.vgrow="NEVER"/>
</VBox>
</Tab>
<Tab text="Calendar Events">
<VBox prefHeight="675.0" prefWidth="300.0">
<Label fx:id="CalendarEventListHeader" maxWidth="1.7976931348623157E308" minHeight="25.0" text="Events"
VBox.vgrow="ALWAYS">
<padding>
<Insets left="5.0"/>
</padding>
</Label>
<StackPane fx:id="calendarPanelPlaceholder" minWidth="600.0" prefHeight="380" prefWidth="900"
VBox.vgrow="ALWAYS"/>
</VBox>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/ToDoListEventCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<HBox id="cardPane" fx:id="cardPane" prefHeight="25.0" prefWidth="400.0" styleClass="container" stylesheets="@DarkTheme.css" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
<CheckBox mnemonicParsing="false" prefHeight="25.0" prefWidth="16.0" styleClass="button-bar" stylesheets="@DarkTheme.css" HBox.hgrow="ALWAYS" />
<Label fx:id="id" prefHeight="24.0" prefWidth="25.0" stylesheets="@DarkTheme.css" text="$id" HBox.hgrow="ALWAYS" />
<Label fx:id="title" prefHeight="24.0" prefWidth="233.0" stylesheets="@DarkTheme.css" text="$title" HBox.hgrow="ALWAYS" />
<Label fx:id="title" prefHeight="24.0" prefWidth="175.0" stylesheets="@DarkTheme.css" text="$title" HBox.hgrow="ALWAYS" />
<Label fx:id="priority" prefHeight="22.0" prefWidth="100.0" stylesheets="@DarkTheme.css" text="$priority" HBox.hgrow="ALWAYS" />
<Button mnemonicParsing="false" prefHeight="23.0" prefWidth="20.0" text="V" />
</HBox>

0 comments on commit 2617d9e

Please sign in to comment.