Skip to content

Commit

Permalink
Feat: Componetens buttons work now
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Apr 16, 2026
1 parent 4b1cb07 commit d4198df
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@

public class FooterController extends BaseController {
@FXML private Button HelpMeHelp;
@FXML private Label aboutUsLink;

@FXML private Button aboutUsLink;


@FXML
public void switchToAboutPage(ActionEvent event) {
System.out.println("Click!");
LoaderScene.LoadScene("aboutPage", event, null, null, authToken);
}
@FXML
public void switchToFrontPage(ActionEvent event) {
System.out.println("Click!");
LoaderScene.LoadScene("FrontPage", event, null, null, authToken);
LoaderScene.LoadScene("frontPage", event, null, null, authToken);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package ntnu.systemutvikling.team6.controller.components;

import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;

import java.awt.*;
import java.awt.event.MouseEvent;

public class NavbarController extends BaseController {
@FXML protected TextField frontSearchField;
@FXML private Button loginButton;
Expand Down Expand Up @@ -41,7 +45,7 @@ private void handleFrontSearch(ActionEvent event){
@FXML
private void switchToFrontPage(ActionEvent event) {
System.out.println("Click!");
LoaderScene.LoadScene("FrontPage", event, null, null, authToken);
LoaderScene.LoadScene("frontPage", event, null, null, authToken);
}

@FXML
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.image.Image?>
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.text.TextFlow?>
<?import javafx.scene.text.Text?>
<HBox alignment="BOTTOM_CENTER" prefHeight="180.0" prefWidth="800.0" style="-fx-background-color: #2f8f8b;" xmlns="http://javafx.com/javafx/21"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ntnu.systemutvikling.team6.controller.components.FooterController" GridPane.rowIndex="2">
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?>

<HBox alignment="BOTTOM_CENTER" prefHeight="180.0" prefWidth="800.0" style="-fx-background-color: #2f8f8b;" GridPane.rowIndex="2" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ntnu.systemutvikling.team6.controller.components.FooterController">
<children>
<GridPane HBox.hgrow="ALWAYS">
<columnConstraints>
Expand All @@ -29,43 +20,47 @@
<children>
<StackPane prefHeight="150.0" prefWidth="200.0">
<children>
<Rectangle fill="#2f8f8b" height="130.0" stroke="TRANSPARENT" strokeType="INSIDE" translateY="1.0" width="800.0" />
<Button fx:id="HelpMeHelp"
onAction="#switchToFrontPage"
style="-fx-background-color: transparent;"
StackPane.alignment="CENTER_LEFT"
translateX="80.0">
<Rectangle fill="#2f8f8b" height="130.0" mouseTransparent="true" stroke="TRANSPARENT" strokeType="INSIDE" translateY="1.0" width="800.0" />
<Button fx:id="HelpMeHelp" alignment="CENTER" contentDisplay="CENTER" onAction="#switchToFrontPage" prefHeight="49.0" prefWidth="170.0" style="-fx-background-color: transparent;" translateX="80.0" StackPane.alignment="CENTER_LEFT">
<graphic>
<TextFlow>
<Text text="Help" fill="WHITE">
<Text fill="WHITE" text="Help">
<font>
<Font name="System Bold" size="26.0"/>
<Font name="System Bold" size="26.0" />
</font>
</Text>

<Text text="Me" fill="#c8e6c9">
<Text fill="#c8e6c9" text="Me">
<font>
<Font name="System Bold" size="26.0"/>
<Font name="System Bold" size="26.0" />
</font>
</Text>

<Text text="Help" fill="WHITE">
<Text fill="WHITE" text="Help">
<font>
<Font name="System Bold" size="26.0"/>
<Font name="System Bold" size="26.0" />
</font>
</Text>
</TextFlow>
</graphic>
<cursor>
<Cursor fx:constant="HAND" />
</cursor>

</Button>
<Rectangle fill="WHITE" height="90.0" stroke="TRANSPARENT" strokeType="INSIDE" translateX="-120.0" width="2.0" />
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" translateX="-40.0" StackPane.alignment="CENTER_LEFT">
<VBox alignment="CENTER" mouseTransparent="true" prefHeight="200.0" prefWidth="100.0" translateX="-40.0" StackPane.alignment="CENTER_LEFT">
<children>
<Label fx:id="aboutUsLink" text="About us" textFill="WHITE"
onMouseClicked="#switchToAboutPage">
<font><Font name="System Bold" size="16.0" /></font>
<cursor><Cursor fx:constant="HAND" /></cursor>
</Label>
<Button fx:id="aboutUsLink" onAction="#switchToAboutPage" style="-fx-background-color: transparent; -fx-padding: 0;" text="About us" textFill="WHITE">

<font>
<Font name="System Bold" size="16.0" />
</font>

<cursor>
<Cursor fx:constant="HAND" />
</cursor>
</Button>
<!--
<Label text="Something else" textFill="WHITE">
<font>
Expand All @@ -88,7 +83,7 @@
</VBox>
</children>
</StackPane>
<StackPane alignment="CENTER_RIGHT" prefHeight="150.0" prefWidth="200.0" GridPane.columnIndex="1">
<StackPane alignment="CENTER_RIGHT" prefHeight="180.0" prefWidth="329.0" GridPane.columnIndex="1">
<children>
<ImageView fitHeight="71.0" fitWidth="161.0" pickOnBounds="true" preserveRatio="true" translateX="-60.0" translateY="-30.0">
<image>
Expand All @@ -105,4 +100,4 @@
</children>
</GridPane>
</children>
</HBox>
</HBox>
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,27 @@
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<ImageView onMouseClicked="#switchToFrontPage" fitHeight="54.0" fitWidth="67.0" pickOnBounds="true" preserveRatio="true" translateX="10.0">
<image>
<Image url="@../../images/Logo.png" />
</image>
<Button onAction="#switchToFrontPage"
prefHeight="54.0"
prefWidth="67.0"
translateX="10.0"
style="-fx-background-color: transparent;">

<graphic>
<ImageView fitHeight="54.0"
fitWidth="67.0"
pickOnBounds="true"
preserveRatio="true">
<image>
<Image url="@../../images/Logo.png" />
</image>
</ImageView>
</graphic>

<cursor>
<Cursor fx:constant="HAND" />
</cursor>
</ImageView>
</Button>
<Label text="Help" textFill="WHITE" translateX="100.0">
<font>
<Font name="System Bold" size="20.0" />
Expand Down

0 comments on commit d4198df

Please sign in to comment.