Skip to content

Commit

Permalink
feat: Styling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelsa committed May 25, 2026
1 parent faa0905 commit e2a5eb2
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
import edu.ntnu.idi.idatt.view.util.ResourceUtils;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
Expand Down Expand Up @@ -204,7 +202,7 @@ private static Parent createDefaultNavigation(Label titleLabel, List<String> but
navigationBuilder.addContent(previous);
}

Button progress = new Button("Advance to next week");
Button progress = new Button("Advance To Next Week");
progress.setOnAction((e) -> {
UserSession.getInstance().getExchange().advance();
UserSession.getInstance().updateGameState();
Expand Down Expand Up @@ -308,7 +306,7 @@ public static Parent createToolbar(ActionEventHandler menuHandle, ActionEventHan

// Player status only advances at purchases, doesn't need to be a observable
// value when saving game state.
Label playerStatus = new Label("Status:" + UserSession.getInstance().getPlayer().getStatus());
Label playerStatus = new Label("Status: " + UserSession.getInstance().getPlayer().getStatus());

Label playerNetWorth = new Label();
playerNetWorth.textProperty().bind(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/ntnu/idi/idatt/view/entry/StartView.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Parent createContent() {
VBox.setMargin(importCsvWrapper, new Insets(0.0, 0.0, 0.0, 50.0));

// Start game button and error log
startButton = new Button("Start Game");
startButton = new Button("Proceed");
startButton.getStyleClass().add("button");
startButton.setMaxWidth(200);
VBox.setMargin(startButton, new Insets(40.0));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package edu.ntnu.idi.idatt.view.primary.finish;

import java.math.BigDecimal;
import java.util.List;

import edu.ntnu.idi.idatt.view.SceneFactory;
Expand All @@ -14,6 +13,7 @@
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;

Expand Down Expand Up @@ -67,8 +67,8 @@ public Parent createContent() {

labels.forEach(l -> CssUtils.apply(l, CssUtils.MED_TEXT_16));

newGame = new Button("New game..");
exit = new Button("Exit..");
newGame = new Button("New Game");
exit = new Button("Quit");

newGame.getStyleClass().add("button");
exit.getStyleClass().add("button");
Expand All @@ -84,6 +84,7 @@ public Parent createContent() {
.wrap(new HBox(10))
.growWithAlignment(Pos.CENTER)
.addAllContent(newGame, exit)
.properties(p -> p.getChildren().forEach(c -> ((Region) c).setPrefWidth(200)))
.unwrap();

return finishUIBuilder.build().makeUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public PlayerInfoSection() {

finishGameButton = new Button("Finish game");
finishGameButton.getStyleClass().add("button");
finishGameButton.setMaxWidth(Double.MAX_VALUE);

new UICompositor.Builder()
.parent(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class TradeSection extends VBox {

Button buyButton = new Button("Buy");
Button portfolioButton = new Button("Sell in portfolio...");
Button portfolioButton = new Button("Sell in Portfolio");
TextField buyInputField = new TextField();
TextValueComponent buyPrice = new TextValueComponent("Price: ");
TextValueComponent buyCost = new TextValueComponent("Taxes & Comission: ");
Expand All @@ -34,12 +34,18 @@ public TradeSection() {
HBox wrapper = new HBox();
wrapper.setSpacing(20.0);
wrapper.getChildren().addAll(buyButton, portfolioButton);
wrapper.setPadding(new Insets(10, 0, 10, 0));

// Detailing

buyButton.getStyleClass().add("button-outlined");
portfolioButton.getStyleClass().add("button-outlined");

buyInputField.setPromptText("Amount of stocks...");
buyInputField.getStyleClass().add("searchbar-field");

this.setPadding(new Insets(20));
this.setMaxWidth(400);
this.setPadding(new Insets(0, 20, 0, 20));
this.setMaxWidth(305);
this.getChildren().addAll(wrapper, buyInputField, buyPrice, buyCost, totalPrice, resultMessage);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void getNetWorth_shouldReturnTotalNetWorth() {
}

@Test
void getStatus_shouldBeAllStatuses() {
void getStatus_shouldCalculateCorrectStatuses() {
assertEquals("Novice", player.getStatus());

// Simulate progress
Expand Down

0 comments on commit e2a5eb2

Please sign in to comment.