Skip to content

Commit

Permalink
Merge pull request #165 from AY2324S2-CS2103T-W12-3/improve-gui-look
Browse files Browse the repository at this point in the history
Improve GUI
  • Loading branch information
bryanyee33 authored Apr 2, 2024
2 parents 23e388a + 683aa99 commit 98bd7cc
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 15 deletions.
9 changes: 9 additions & 0 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import javafx.fxml.FXML;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TextInputControl;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.KeyCombination;
Expand Down Expand Up @@ -37,6 +39,7 @@ public class MainWindow extends UiPart<Stage> {
private final PersonListPanel personListPanel;
private final ResultDisplay resultDisplay = new ResultDisplay();
private final HelpWindow helpWindow = new HelpWindow();
private final String iconPath = "/images/icon.png";

@FXML
private StackPane commandBoxPlaceholder;
Expand All @@ -53,6 +56,9 @@ public class MainWindow extends UiPart<Stage> {
@FXML
private StackPane statusbarPlaceholder;

@FXML
private ImageView iconImageView;

/**
* Creates a {@code MainWindow} with the given {@code Stage} and {@code Logic}.
*/
Expand Down Expand Up @@ -125,6 +131,9 @@ private void fillInnerParts() {

CommandBox commandBox = new CommandBox(this::executeCommand);
commandBoxPlaceholder.getChildren().add(commandBox.getRoot());

Image iconImage = new Image(iconPath);
iconImageView.setImage(iconImage);
}

/**
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 @@ -20,7 +20,7 @@ public class UiManager implements Ui {
public static final String ALERT_DIALOG_PANE_FIELD_ID = "alertDialogPane";

private static final Logger logger = LogsCenter.getLogger(UiManager.class);
private static final String ICON_APPLICATION = "/images/address_book_32.png";
private static final String ICON_APPLICATION = "/images/icon_title.png";

private final Logic logic;
private MainWindow mainWindow;
Expand Down
Binary file added src/main/resources/images/icon.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/icon_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
-fx-opacity: 1;
}

.title_label {
-fx-font-family: "Segoe UI Semibold";
-fx-font-size: 21px;
-fx-text-fill: white;
}

.text-field {
-fx-font-size: 12pt;
-fx-font-family: "Segoe UI Semibold";
Expand Down
38 changes: 27 additions & 11 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
<?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.scene.layout.HBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.ImageView?>
<fx:root type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1"
title="AssetBook-3" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
title="AssetBook" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
<icons>
<Image url="@/images/address_book_32.png" />
<Image url="@/images/icon_title.png" />
</icons>
<scene>
<Scene>
Expand All @@ -33,25 +35,39 @@
</Menu>
</MenuBar>

<StackPane VBox.vgrow="NEVER" fx:id="commandBoxPlaceholder" styleClass="pane-with-border">
<HBox styleClass="pane-with-border" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<padding>
<Insets top="5" right="10" bottom="5" left="10" />
<Insets top="10" right="15" bottom="10" left="15" />
</padding>
</StackPane>
<children>
<ImageView fx:id="iconImageView" preserveRatio="true" fitWidth="50" fitHeight="50"/>
<Label fx:id="iconName" text="AssetBook" styleClass="title_label" HBox.hgrow="ALWAYS">
<padding>
<Insets left="12" top="5"/>
</padding>
</Label>
</children>
</HBox>

<VBox fx:id="personList" styleClass="pane-with-border" minWidth="340" prefWidth="340" VBox.vgrow="ALWAYS">
<padding>
<Insets bottom="10" />
</padding>
<StackPane fx:id="personListPanelPlaceholder" VBox.vgrow="ALWAYS"/>
</VBox>

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

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

<StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
</VBox>
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/view/ResultDisplay.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<?import javafx.scene.layout.StackPane?>

<StackPane fx:id="placeHolder" styleClass="pane-with-border" xmlns="http://javafx.com/javafx/17"
xmlns:fx="http://javafx.com/fxml/1">
<TextArea fx:id="resultDisplay" editable="false" styleClass="result-display"/>
xmlns:fx="http://javafx.com/fxml/1" minHeight="125">
<TextArea fx:id="resultDisplay" editable="false" wrapText="true" styleClass="result-display"/>
</StackPane>
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/commons/util/AppUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class AppUtilTest {

@Test
public void getImage_exitingImage() {
assertNotNull(AppUtil.getImage("/images/address_book_32.png"));
assertNotNull(AppUtil.getImage("/images/icon_title.png"));
}

@Test
Expand Down

0 comments on commit 98bd7cc

Please sign in to comment.