-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: made LoginHeader for LoginPageView
- Loading branch information
MatheaGjerde
committed
Mar 10, 2026
1 parent
1a9aef9
commit 16ce552
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/main/java/edu/group5/app/view/loginpage/LoginHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package edu.group5.app.view.loginpage; | ||
|
|
||
| import edu.group5.app.control.HeaderController; | ||
| import javafx.geometry.Pos; | ||
| import javafx.scene.image.Image; | ||
| import javafx.scene.image.ImageView; | ||
| import javafx.scene.layout.BorderPane; | ||
| import javafx.scene.layout.StackPane; | ||
|
|
||
| public class LoginHeader extends BorderPane { | ||
| private final HeaderController controller; | ||
|
|
||
| public LoginHeader(HeaderController controller) { | ||
| this.controller = controller; | ||
| getStylesheets().add(getClass().getResource("/homepage/header.css").toExternalForm()); | ||
| setId("header"); | ||
|
|
||
| setCenter(getLogoSection()); | ||
| } | ||
| private StackPane getLogoSection() { | ||
| StackPane logoSection = new StackPane(); | ||
| logoSection.setId("logo-section"); | ||
| logoSection.setAlignment(Pos.CENTER); | ||
| logoSection.setOnMouseClicked(e -> controller.handleHomeBtn()); | ||
| logoSection.setStyle("-fx-cursor: hand;"); | ||
|
|
||
| ImageView logo = new ImageView( | ||
| new Image(getClass().getResource("/homepage/hmh-logo.png").toExternalForm()) | ||
| ); | ||
| logo.setFitHeight(60); | ||
| logo.setPreserveRatio(true); | ||
|
|
||
| logoSection.getChildren().add(logo); | ||
| return logoSection; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters