Skip to content

Commit

Permalink
Merge pull request #112 from Team-40-IDATT2003/111-fix-css-merge-conf…
Browse files Browse the repository at this point in the history
…lict

111 fix css merge conflict
  • Loading branch information
etsorens authored May 23, 2026
2 parents abcdc1b + 85db07d commit cde71bc
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 39 deletions.
18 changes: 10 additions & 8 deletions src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.stats.StatsView;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.topbar.TopBarController;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.topbar.TopBarView;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.transactions.TransactionsController;
import edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.transactions.TransactionsView;
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
Expand Down Expand Up @@ -130,12 +132,12 @@ public void start(final Stage stage) throws Exception {
// Dashboard er default center-view.
InGameView inGameView = new InGameView(topBarView, dashBoardView.getRootPane());

// Transactions-widgeten finnes ikke enda - bruker dashboardet som
// placeholder slik at TRANSACTIONS-knappen ikke krasjer. Bytt ut når
// den faktiske transactions-widgeten er på plass.
Node transactionsCenter = dashBoardView.getRootPane();
Runnable onTransactionUpdate = () -> {
};
// Transaction history page
TransactionsView transactionsView = new TransactionsView();
TransactionsController transactionsController = new TransactionsController(
transactionsView,
eventManager,
player.getTransactionArchive());

// Wire top bar buttons til å bytte mellom dashboard / stats / market /
// transactions. Stats-knappen tar deg til stats-siden.
Expand All @@ -144,8 +146,8 @@ public void start(final Stage stage) throws Exception {
dashBoardView.getRootPane(),
marketView.getRootPane(),
statsView.getRootPane(),
transactionsCenter,
onTransactionUpdate);
transactionsView.getRootPane(),
transactionsController::refresh);

// Register all views
viewManager.addView(mainMenuView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,20 +346,20 @@ private ColumnConstraints makeCol(final float w) {

@Override
protected void initStyling() {
completeSideBar.getStyleClass().add("complete-market-sidebar");
sidebar.getStyleClass().add("market-sidebar");
selectedStockLabel.getStyleClass().add("selected-stock-pill");
selectedStockPriceLabel.getStyleClass().add("selected-stock-pill");
shareQuantityInputField.getStyleClass().add("qtyTextField");
completeSideBar.getStyleClass().add("dashboard-complete-sidebar");
sidebar.getStyleClass().add("dashboard-sidebar-content");
selectedStockLabel.getStyleClass().add("dashboard-selected-stock-pill");
selectedStockPriceLabel.getStyleClass().add("dashboard-selected-stock-pill");
shareQuantityInputField.getStyleClass().add("dashboard-qtyTextField");
chart.getStyleClass().add("dashboard-chart");
scrollPane.getStyleClass().add("dashboard-sidebar-scrollPane");
mainContent.getStyleClass().add("dashboard-mainContent-VBox");
m5QtyBtn.getStyleClass().add("qtyBtn");
m1QtyBtn.getStyleClass().add("qtyBtn");
p1QtyBtn.getStyleClass().add("qtyBtn");
p5QtyBtn.getStyleClass().add("qtyBtn");
buySharesBtn.getStyleClass().add("buy-button");
sellSharesBtn.getStyleClass().add("sell-button");
m5QtyBtn.getStyleClass().add("dashboard-qtyBtn");
m1QtyBtn.getStyleClass().add("dashboard-qtyBtn");
p1QtyBtn.getStyleClass().add("dashboard-qtyBtn");
p5QtyBtn.getStyleClass().add("dashboard-qtyBtn");
buySharesBtn.getStyleClass().add("dashboard-buy-button");
sellSharesBtn.getStyleClass().add("dashboard-sell-button");
header.getStyleClass().add("dashboard-header");
stockIdentity.getStyleClass().add("dashboard-stockIdentity");
priceStats.getStyleClass().add("dashboard-priceStats");
Expand All @@ -369,6 +369,7 @@ protected void initStyling() {
rightQty.getStyleClass().add("dashboard-rightQty");
qtySection.getStyleClass().add("dashboard-qtySection");
tradeBtns.getStyleClass().add("dashboard-tradeBtns");
timeRangeSelector.getStyleClass().add("dashboard-combo-box");
}

/**
Expand Down Expand Up @@ -405,7 +406,7 @@ public void addOwnedShares(final float val) {
public Button createStockButton(final String text) {
Button button = new Button(text);
sidebar.getChildren().add(button);
button.getStyleClass().add("stock-button");
button.getStyleClass().add("dashboard-stock-button");
return button;
}

Expand Down
248 changes: 229 additions & 19 deletions src/main/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,35 +236,52 @@
}


/* --------------- IN GAME VIEW ------------- */
.market-sidebar {
/* --------------- Dashboard widget ------------- */
.dashboard-complete-sidebar {
-fx-border-color: #000000;
-fx-border-width: 0 2 0 0;
-fx-border-style: solid;
-fx-padding: 20;
-fx-spacing: 10;
}

.stock-button {
.dashboard-sidebar-content {
-fx-padding: 10;
-fx-spacing: 10;
-fx-alignment: TOP_CENTER;

-fx-min-width: 150;
-fx-pref-width: 150;

}

.dashboard-stock-button {
-fx-background-color: #e0e0e0;
-fx-alignment: CENTER_LEFT;
-fx-padding: 10 15 10 15;
-fx-font-weight: bold;
-fx-font-style: italic;
-fx-text-fill: black;
-fx-font-size: 24;
-fx-font-size: 13;

}

.stock-button : hover {
.dashboard-stock-button:hover {
-fx-cursor: hand;
-fx-scale-x: 1.05;
-fx-scale-y: 1.05;
}

.selected-stock-pill {
.dashboard-selected-stock-pill {
-fx-background-color: #e0e0e0;
-fx-background-radius: 10;
-fx-padding: 10 40;
-fx-font-size: 24;
-fx-font-weight: bold;
-fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.2), 5, 0, 0, 2);
-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.2), 5, 0, 0, 2);
}

.buy-button {
.dashboard-buy-button {
-fx-graphic: url('Icons/plus2.png');
-fx-content-display: left;
-fx-graphic-text-gap: 10;
Expand All @@ -273,32 +290,142 @@
-fx-text-fill: black;
-fx-font-style: italic;
-fx-font-weight: bold;
-fx-min-height: 60;
-fx-pref-height: 80;
-fx-min-width: 150;
-fx-max-width: 250;

-fx-min-height: 30;
-fx-pref-height: 45;
-fx-max-height: 60;

-fx-min-width: 60;
-fx-pref-width: 80;
-fx-max-width: 200;
}

.sell-button {
.dashboard-sell-button {
-fx-graphic: url('Icons/minus2.png');
-fx-background-color: #d50000;
-fx-background-radius: 30;
-fx-text-fill: black;
-fx-font-style: italic;
-fx-font-weight: bold;
-fx-min-height: 60;
-fx-pref-height: 80;
-fx-min-width: 150;
-fx-max-width: 250;

-fx-min-height: 30;
-fx-pref-height: 45;
-fx-max-height: 60;

-fx-min-width: 60;
-fx-pref-width: 80;
-fx-max-width: 200;
}

.buy-button:hover,
.sell-button:hover {
.dashboard-buy-button:hover, .dashboard-sell-button:hover {
-fx-cursor: hand;
-fx-scale-x: 1.05;
-fx-scale-y: 1.05;
}
.dashboard-qtyBtn {
-fx-background-color: rgba(140, 140, 140, 0.6);

-fx-background-radius: 50;

-fx-text-fill: white;
-fx-font-weight: bold;
-fx-font-size: 14px;

-fx-min-width: 60;
-fx-pref-width: 75;
-fx-max-width: 90;

-fx-min-height: 20;
-fx-pref-height: 30;
-fx-max-height: 40;
}

.dashboard-qtyBtn:hover {
-fx-cursor: hand;
-fx-scale-x: 1.05;
-fx-scale-y: 1.05;
}

.dashboard-qtyTextField {
-fx-alignment: CENTER;

-fx-min-width: 50;
-fx-pref-width: 75;
-fx-max-width: 100;

-fx-min-height: 30;
-fx-pref-height: 45;
-fx-max-height: 60;
}

.dashboard-combo-box {
-fx-background-color: #f4f4f4;
-fx-border-color: #d1d1d1;
-fx-border-radius: 5;
-fx-background-radius: 5;
}

.dashboard-combo-box .list-cell {
-fx-text-fill: #333333;
}

.dashboard-sidebar-scrollPane {
-fx-min-width: 150;
-fx-background-color: transparent;
-fx-border-color: transparent;
-fx-padding: 0;
}

.dashboard-sidebar-scrollPane > .viewport {
-fx-background-color: transparent;
}

.dashboard-mainContent-VBox {
-fx-padding: 30;
-fx-spacing: 20;
-fx-alignment: TOP_LEFT;
}

.dashboard-chart {
-fx-min-height: 200;
-fx-pref-height: 650;
}

.dashboard-header {
-fx-spacing: 20;
}

.dashboard-stockIdentity {
-fx-spacing: 5;
}

.dashboard-priceStats {
-fx-spacing: 5;
}

.dashboard-lowhigh {
-fx-spacing: 10;
}

.dashboard-grid {
-fx-alignment: CENTER;
}

.dashboard-leftQty {
-fx-alignment: CENTER_RIGHT;
}

.dashboard-rightQty {
-fx-alignment: CENTER_LEFT;
}

.dashboard-qtySection {
-fx-alignment: CENTER;
}

.dashboard-tradeBtns {
-fx-alignment: CENTER;
}
/* ------------- MARKET VIEW ------------- */
/* Root pane fills the center area with a light translucent background. */
.market-container {
Expand Down Expand Up @@ -587,4 +714,87 @@
-fx-font-style: italic;
-fx-text-fill: #555555;
-fx-padding: 20;
}

/* ---------------- TRANSACTIONS VIEW ---------------- */
.transactions-root {
-fx-spacing: 20;
-fx-padding: 15;
-fx-alignment: TOP_CENTER;
}

.transactions-root .label {
-fx-text-fill: black;
}

.transactions-searchBar {
-fx-spacing: 10;
-fx-alignment: CENTER_LEFT;
-fx-border-color: #000000;
-fx-border-width: 1.5;
-fx-background-color: #E0E0E0;
-fx-padding: 10;
}

.transactions-searchLabel {
-fx-font-size: 14;
}

.transactions-searchField {
-fx-background-color: white;
-fx-border-color: #CCCCCC;
}

.transactions-weekField {
-fx-pref-width: 75px;
-fx-min-width: 75px;
-fx-background-color: white;
-fx-border-color: #000000;
-fx-border-width: 1.5px;
-fx-alignment: CENTER;
}

.transactions-weekField .list-cell {
-fx-text-fill: black;
-fx-font-weight: bold;
-fx-alignment: center;
}

.transactions-transactionCard {
-fx-spacing: 15;
-fx-padding: 25;
-fx-alignment: TOP_CENTER;
-fx-pref-width: 260;
-fx-pref-height: 320;
-fx-background-color: #D6D6D6;
-fx-background-radius: 35;
-fx-border-color: #000000;
-fx-border-radius: 35;
-fx-border-width: 1.5;
}

.transactions-typeLabel {
-fx-font-size: 28;
-fx-font-weight: bold;
}

.transactions-infoBox {
-fx-spacing: 8;
-fx-alignment: CENTER;
}

.transactions-cardText {
-fx-font-size: 14;
}

.transactions-cardsContainer {
-fx-spacing: 25;
-fx-alignment: CENTER_LEFT;
-fx-padding: 10;
}

.transactions-scrollPane {
-fx-fit-to-height: true;
-fx-background: transparent;
-fx-background-color: transparent;
}

0 comments on commit cde71bc

Please sign in to comment.