Skip to content

Commit

Permalink
Merge 1857cae into d3d3449
Browse files Browse the repository at this point in the history
  • Loading branch information
Kratious committed Oct 23, 2018
2 parents d3d3449 + 1857cae commit 379a85b
Show file tree
Hide file tree
Showing 8 changed files with 262 additions and 70 deletions.
46 changes: 46 additions & 0 deletions src/main/java/seedu/address/ui/ContextIndicator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package seedu.address.ui;

import com.google.common.eventbus.Subscribe;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.Region;

import seedu.address.commons.events.ui.ContextChangeEvent;
import seedu.address.model.Context;

/**
* An UI component that displays information of the {@code Context}.
*/
public class ContextIndicator extends UiPart<Region> {

private static final String FXML = "ContextIndicator.fxml";

@FXML
private Label contextName;

public ContextIndicator(String contextId) {
super(FXML);
setContextName(contextId);
registerAsAnEventHandler(this);
}

@Subscribe
private void handleContextChangeEvent(ContextChangeEvent event) {
System.out.println(event.getNewContext());
setContextName(event.getNewContext());
}

private void setContextName(String contextId) {
if (contextId.equals(Context.VOLUNTEER_CONTEXT_ID)) {
contextName.setText(Context.VOLUNTEER_CONTEXT_NAME.substring(0, 1).toUpperCase()
+ Context.VOLUNTEER_CONTEXT_NAME.substring(1));
} else if (contextId.equals(Context.EVENT_CONTEXT_ID)) {
contextName.setText(Context.EVENT_CONTEXT_NAME.substring(0, 1).toUpperCase()
+ Context.EVENT_CONTEXT_NAME.substring(1));
} else if (contextId.equals(Context.RECORD_CONTEXT_ID)) {
contextName.setText(Context.RECORD_CONTEXT_NAME.substring(0, 1).toUpperCase()
+ Context.RECORD_CONTEXT_NAME.substring(1));
}
}
}
8 changes: 8 additions & 0 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import seedu.address.commons.events.ui.ExitAppRequestEvent;
import seedu.address.commons.events.ui.ShowHelpRequestEvent;
import seedu.address.logic.Logic;
import seedu.address.model.Context;
import seedu.address.model.UserPrefs;

/**
Expand All @@ -40,6 +41,7 @@ public class MainWindow extends UiPart<Stage> {

// Independent Ui parts residing in this Ui container
private BrowserPanel browserPanel;
private ContextIndicator contextIndicator;
private PersonListPanel personListPanel;
private EventListPanel eventListPanel;
private RecordEventPanel recordEventPanel;
Expand All @@ -56,6 +58,9 @@ public class MainWindow extends UiPart<Stage> {
@FXML
private MenuItem helpMenuItem;

@FXML
private StackPane contextIndicatorPlaceholder;

@FXML
private StackPane listPanelPlaceholder;

Expand Down Expand Up @@ -135,6 +140,9 @@ void fillInnerParts() {

recordEventPanel = new RecordEventPanel(logic.getFilteredRecordList(), logic.getFilteredPersonList());

contextIndicator = new ContextIndicator(Context.VOLUNTEER_CONTEXT_ID);
contextIndicatorPlaceholder.getChildren().add(contextIndicator.getRoot());

listPanelPlaceholder.getChildren().add(personListPanel.getRoot());

ResultDisplay resultDisplay = new ResultDisplay();
Expand Down
Binary file added src/main/resources/fonts/IBMPlexSans-Regular.ttf
Binary file not shown.
Binary file added src/main/resources/fonts/OpenSans-Regular.ttf
Binary file not shown.
9 changes: 9 additions & 0 deletions src/main/resources/view/ContextIndicator.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.HBox?>

<HBox id="contextIndicator" fx:id="contextIndicator" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<Label id="contextName" fx:id="contextName" styleClass="cell_big_label"></Label>
</HBox>

179 changes: 179 additions & 0 deletions src/main/resources/view/Custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
.root {
-black-1-: #0c0c0c;
-grey-1-: #212121;
-grey-2-: #303030;
-grey-3-: #424242;
-grey-4-: #e6e6e6;
-white-1-: #F5F5F5;

-primary-: #3E50B4;
-secondary-: #FF3F80;

-font-: #98a6ad;
-background-: #323b44;
-card-: #36404a;

-yellow-primary-: #FFDE03;
-blue-primary-: #0336FF;
-red-primary-: #FF0266;

-blue-1-: #004ba0;
-blue-2-: #1976d2;
-blue-3-: #63a4ff;
-blue-n-: #0081cb;

-grey-b-: #E1E2E1;
-grey-s-: #969696;

-swatch-100: #BBDEFB;
-swatch-200: #90CAF9;
-swatch-300: #64BEF6;
-swatch-400: #42A5F5;
-swatch-500: #2196F3;
-swatch-grey: #c8c8c8;
-swatch-dark-grey: #969696;
-swatch-light-grey: #e6e6e6;
-swatch-toolbar: #F5F5F5;
-swatch-toolbar-selected: #D7D7D7;
}

@font-face {
font-family: 'Open Sans';
src: url('../fonts/OpenSans-Regular.ttf');
}

@font-face {
font-family: 'IBM Plex Sans';
src: url('../fonts/IBMPlexSans-Regular.ttf');
}

.background {
-fx-background-color: -grey-b-;
background-color: -grey-b-; /* Used in the default.html file */
}

.menu-bar {
-fx-background-color: -blue-1-;
}

.grid-pane .stack-pane {
-fx-background-color: -blue-1-;
}

#contextIndicator {
-fx-font-family: "Open Sans";
-fx-background-color: -blue-2-;
-fx-padding: 10 10 10 10;
}

#contextIndicator .label {
-fx-font-size: 1.5em;
-fx-padding: 5 5 5 8;
-fx-text-fill: -white-1-;
}

#browserPlaceholder {
-fx-padding: 12;
-fx-background-color: -background-;
-fx-background-insets: 0px, 10px;
-fx-border-radius: 2;
-fx-effect: dropshadow(gaussian, rgb(0.0, 0.0, 0.0, 0.15), 6.0, 0.7, 0.0, 1.5);
}

.split-pane:horizontal .split-pane-divider {
-fx-padding: 1 0 1 0;
-fx-background-insets: 0;
-fx-border-color: transparent;
-fx-background-color: -background-;
}


.split-pane {
-fx-box-boder: transparent;
-fx-padding: 0;
-fx-background-inset: 0;
-fx-border-radius: 0;
-fx-border-width: 0;
-fx-background-color: transparent;
}

.list-view {
-fx-background-insets: 0;
-fx-padding: 0px;
-fx-background-color: -grey-b-;
}

.list-cell {
-fx-padding: 12px;
-fx-background-color: transparent, -white-1-;
-fx-background-insets: 0px, 0px;
-fx-border-radius: 1;
-fx-border-width: 0 0 1 0;
-fx-border-color: -grey-b-;
}

.list-cell:empty {
-fx-padding: 2px;
-fx-background-color: transparent;
-fx-background-insets: 0;
}

.list-cell:filled:hover {
-fx-background-color: transparent, rgb(200.0, 200.0, 200.0);
}

.list-cell:filled:selected {
-fx-background-color: transparent, derive(#42A5F5, 50%);
}

.list-cell:filled:selected #cardPane {
-fx-border-color: #3080e8;
-fx-border-width: 0 0 0 0;
}

.list-cell .label {
-fx-text-fill: -grey-1-;
-fx-font-family: "IBM Plex Sans";
}

.scroll-bar:vertical>.track-background, .scroll-bar:horizontal>.track-background
{
-fx-background-color: -grey-b-;
-fx-background-insets: 1 0 0 0;
}

.scroll-bar:vertical>.thumb, .scroll-bar:horizontal>.thumb {
-fx-background-color: -grey-s-;
-fx-background-insets: 0;
-fx-background-radius: 0;
}

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

.scroll-bar>.increment-button>.increment-arrow, .scroll-bar>.decrement-button>.decrement-arrow
{
-fx-background-color: -grey-s-;
}

.scroll-bar>.track-background {
-fx-background-color: transparent;
}


#totalVolunteersStatus exit.label {
-fx-alignment: center;
}

#eventNameBox .label{
-fx-font-size: 18pt;
-fx-text-fill: -grey-1-;
}

#numOfVolunteerBox .label{
-fx-font-size: 14pt;
-fx-text-fill: -grey-1-;
}
52 changes: 2 additions & 50 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.background {
-fx-background-color: derive(#1d1d1d, 20%);
background-color: #383838; /* Used in the default.html file */
-fx-background-color: #36404a;
background-color: #36404a; /* Used in the default.html file */
}

.label {
Expand Down Expand Up @@ -76,11 +76,6 @@
-fx-background-color: -fx-focus-color;
}

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

.split-pane {
-fx-border-radius: 1;
-fx-border-width: 1;
Expand All @@ -99,18 +94,6 @@
-fx-padding: 0 0 0 0;
}

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

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

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

.list-cell:filled:selected #cardPane {
-fx-border-color: #3e7b91;
-fx-border-width: 1;
Expand Down Expand Up @@ -290,23 +273,6 @@
-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;
}

#cardPane {
-fx-background-color: transparent;
-fx-border-width: 0;
Expand Down Expand Up @@ -350,17 +316,3 @@
-fx-background-radius: 2;
-fx-font-size: 11;
}

#totalVolunteersStatus exit.label {
-fx-alignment: center;
}

#eventNameBox .label{
-fx-font-size: 18pt;
-fx-text-fill: white;
}

#numOfVolunteerBox .label{
-fx-font-size: 14pt;
-fx-text-fill: white;
}
Loading

0 comments on commit 379a85b

Please sign in to comment.