Skip to content

Change background images to gradients and remove redudant code #92

Merged
merged 1 commit into from
May 13, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,7 @@ public BorderPane getRoot() {
root.getStylesheets().add(getClass().getResource("/css/global.css").toExternalForm());
root.getStylesheets().add(getClass().getResource("/css/desktop.css").toExternalForm());
root.getStylesheets().add(getClass().getResource("/css/apps.css").toExternalForm());

Image backgroundImage = new Image(
Objects.requireNonNull(getClass().getResourceAsStream("/Images/mac_home_background.jpg")),
1920, 1080,
true, // preserve aspect ratio
true // smooth scaling
);

// Configure background to cover the full container without tiling
BackgroundSize backgroundSize = new BackgroundSize(
BackgroundSize.AUTO, BackgroundSize.AUTO,
false,
false,
false,
true
);

BackgroundImage background = new BackgroundImage(
backgroundImage,
BackgroundRepeat.NO_REPEAT,
BackgroundRepeat.NO_REPEAT,
BackgroundPosition.CENTER,
backgroundSize
);

root.setBackground(new Background(background));
root.getStyleClass().add("desktop-root");

return root;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ public class StartView {
public StackPane getRoot() {
StackPane root = new StackPane();

// Background image
Image backgroundImage = new Image(Objects.requireNonNull(getClass().getResourceAsStream("/Images/windows7_login_background.jpg")), 1920, 1080, true, true);
BackgroundImage background = new BackgroundImage(
backgroundImage,
BackgroundRepeat.NO_REPEAT,
BackgroundRepeat.NO_REPEAT,
BackgroundPosition.CENTER,
new BackgroundSize(BackgroundSize.AUTO, BackgroundSize.AUTO, false, false, true, true)
);
root.setBackground(new Background(background));

// User input content
VBox loginContainer = new VBox(20);
loginContainer.setAlignment(Pos.CENTER);
Expand Down
Binary file removed src/main/resources/Images/mac_home_background.jpg
Binary file not shown.
Binary file not shown.
Binary file added src/main/resources/Sounds/mouse_click.wav
Binary file not shown.
4 changes: 4 additions & 0 deletions src/main/resources/css/desktop.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.desktop-root {
-fx-background-color: linear-gradient(#263B6A, #6984A9);
}

.desktop-bottom-bar {
-fx-background-color: rgba(0, 0, 0, 0.7);
-fx-background-radius: 0;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/css/login.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.login-root {
-fx-font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
-fx-background-color: linear-gradient(#FF9D23, #EA5252);
}

.login-container {
Expand Down