From 6f609eb229a0bce1882c00022801802716ee107d Mon Sep 17 00:00:00 2001 From: Jonas Pohl Date: Sun, 7 Jan 2024 21:16:10 +0100 Subject: [PATCH] Fixing darkmode for application --- .github/workflows/build.yml | 4 ++-- .../java/com/JayPi4c/RobbiSimulator/utils/SceneManager.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00ed47e..8bea30e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,9 @@ jobs: name: Verify project runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' diff --git a/src/main/java/com/JayPi4c/RobbiSimulator/utils/SceneManager.java b/src/main/java/com/JayPi4c/RobbiSimulator/utils/SceneManager.java index 6374eb2..49b1928 100644 --- a/src/main/java/com/JayPi4c/RobbiSimulator/utils/SceneManager.java +++ b/src/main/java/com/JayPi4c/RobbiSimulator/utils/SceneManager.java @@ -5,6 +5,8 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import java.util.Objects; + /** * Class to manage the loaded scene. * @@ -14,7 +16,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public class SceneManager { - private static final String DARK_MODE_CSS = "/css/dark-theme.css"; + private static final String DARK_MODE_CSS = Objects.requireNonNull(SceneManager.class.getResource("/css/dark-theme.css")).toExternalForm(); /** * The boolean on which elements can bind in order to be updated on dark-mode