Skip to content

Commit

Permalink
Merge pull request #180 from FionaQY/update-help-window
Browse files Browse the repository at this point in the history
Update Help Window
  • Loading branch information
FionaQY authored Nov 6, 2024
2 parents 53b564e + d157a0e commit 63e49e1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 19 deletions.
51 changes: 37 additions & 14 deletions src/main/java/seedu/address/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
Expand All @@ -27,7 +28,8 @@ public class HelpWindow extends UiPart<Stage> {

public static final String USERGUIDE_URL =
"https://ay2425s1-cs2103t-t14-4.github.io/tp/UserGuide.html#quick-start";
public static final String HELP_MESSAGE =

public static final String HELP_WINDOW_MESSAGE =
"For more information, please refer to the user guide.";

private static final Logger logger = LogsCenter.getLogger(HelpWindow.class);
Expand All @@ -36,6 +38,9 @@ public class HelpWindow extends UiPart<Stage> {
@FXML
private TableView<CommandSummary> commandTable;

@FXML
private StackPane moreInfo;

@FXML
private VBox mainContainer;

Expand All @@ -51,6 +56,10 @@ public HelpWindow(Stage root) {
Label titleLabel = new Label("Command Summary");
titleLabel.getStyleClass().add("help-title");
mainContainer.getChildren().add(0, titleLabel);
Label infoLabel = new Label(HELP_WINDOW_MESSAGE); // Use HELP_MESSAGE for the label text
infoLabel.getStyleClass().add("label"); // Add CSS style
moreInfo.getChildren().add(infoLabel); // Add the label to moreInfo
moreInfo.setPrefHeight(30);
initializeCommandTable();
}

Expand Down Expand Up @@ -84,9 +93,6 @@ private void initializeCommandTable() {
commandTable.getColumns().addAll(actionCol, commandFormatCol, exampleCol);

commandTable.getItems().addAll(
new CommandSummary("Save Data Automatically",
"Automatic",
"No command required"),
new CommandSummary(
"Add New Client",
"add n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> "
Expand All @@ -101,22 +107,39 @@ private void initializeCommandTable() {
+ "[t/ <TIER>] [s/ <STATUS>]"
+ "[rn/ <NEW REMARK>] [ra/ <REMARK TO BE APPENDED ONTO EXISTING ONE>]",
"edit 69 n/ TAN LESHEW p/ 77337733 e/ [email protected] a/ COM3 j/ doctor i/ 1000000000 "
+ "ra/ Specialist in eye care"),
new CommandSummary("Find a Client by Details",
"filter <FLAG>/ <FLAG FIELD>",
"filter n/ TAN LESHEW"),
new CommandSummary("Undo Previous Command",
"undo",
"undo"),
new CommandSummary("Help",
+ "t/ bronze s/ urgent ra/ Specialist in eye care"),
new CommandSummary("List All Clients",
"list",
"list"),
new CommandSummary("Filter Client List",
"filter [n/<NAME>] [p/<PHONE>] [e/<EMAIL>] [a/<ADDRESS>] [j/<JOB>] [r/<REMARK>] "
+ "[t/<TIER>] [i/<INCOME>]",
"filter n/ TAN LESHEW t/ gold"),
new CommandSummary("View Client Details",
"view <INDEX>",
"view 1"),
new CommandSummary("Close Client Details",
"close",
"close"),
new CommandSummary("View Help",
"help",
"help"),
new CommandSummary("Exit",
new CommandSummary("Undo Command",
"undo",
"undo"),
new CommandSummary("Exit Application",
"exit",
"exit")
"exit"),
new CommandSummary("Clear All Data",
"clear",
"clear"),
new CommandSummary("Save Data Automatically",
"Automatic",
"No command required")
);

commandTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
commandTable.setPrefHeight(450);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/view/HelpWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>

<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.control.Label?>
<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/help_icon.png" />
Expand All @@ -27,6 +31,7 @@
<TableView fx:id="commandTable" VBox.vgrow="ALWAYS" />

<VBox fx:id="helpMessageContainer" styleClass="help-message-container">
<StackPane fx:id="moreInfo" styleClass="more-info" />
<Button fx:id="copyButton" mnemonicParsing="false" onAction="#copyUrl" text="Copy link to User Guide">
</Button>
</VBox>
Expand Down
17 changes: 12 additions & 5 deletions src/main/resources/view/css/HelpWindow.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
-fx-fill: #e6e6e6;
}

.help-window .web-view {
-fx-background-color: #3c3f41;
-fx-pref-height: 50px;
}

.help-window .button {
-fx-background-color: #4b6eaf;
-fx-text-fill: #e6e6e6;
Expand All @@ -88,3 +83,15 @@
-fx-padding: 10 0 10 0;
-fx-alignment: center;
}

.more-info {
-fx-background-color: derive(#1d1d1d, 20%);
-fx-border-color: derive(#1d1d1d, 25%);

}

.more-info .label {
-fx-font-size: 14pt;
-fx-text-fill: white;
-fx-alignment: center;
}

0 comments on commit 63e49e1

Please sign in to comment.