Skip to content

Commit

Permalink
Tried alot of thing but decided to just hack my way through
Browse files Browse the repository at this point in the history
  • Loading branch information
octo-kumo committed Aug 15, 2020
1 parent 3897a0f commit 4309377
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group 'app.nush'
version '1.3.9-beta'
version '1.3.A-beta'

applicationName = 'Exam Clock'
mainClassName = 'app.nush.examclock.Main'
Expand All @@ -20,7 +20,7 @@ repositories {
// }
}

double jdkVersion = 1.8
double jdkVersion = 1.14
println "JDK version = ${jdkVersion}"

sourceCompatibility = 1.8
Expand Down Expand Up @@ -78,6 +78,5 @@ jar {
'Specification-Title': "Exam Clock",
'Specification-Version': "$version",
'Specification-Vendor': "Appventure@NUSHIGH")

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
import com.dlsc.preferencesfx.model.Category;
import com.dlsc.preferencesfx.model.Group;
import com.dlsc.preferencesfx.model.Setting;
import com.dlsc.preferencesfx.view.PreferencesFxView;
import javafx.beans.property.*;
import javafx.scene.Scene;
import javafx.scene.control.DialogPane;
import javafx.scene.paint.Color;
import javafx.stage.Modality;
import javafx.stage.Stage;

/**
Expand Down Expand Up @@ -65,6 +69,8 @@ public class PreferenceController {
public static String clockID;
private final MainController controller;
private PreferencesFx preferencesFx;
private PreferencesFxView view;
private Stage stage;

/**
* Instantiates a new Preference controller.
Expand Down Expand Up @@ -127,14 +133,15 @@ public void initPreferences() {
Setting.of("Open to requests", openToRequestsProperty)
)
)
);
preferencesFx.getView().getScene().getStylesheets().addAll("/theme.css", nightMode.get() ? "/theme.dark.css" : "/theme.light.css");
preferencesFx.getView().getStyleClass().add("preference");
Stage window = (Stage) preferencesFx.getView().getScene().getWindow();
window.setMaxHeight(500);
window.setWidth(600);
window.setHeight(500);
preferencesFx.persistWindowState(true);
).persistWindowState(true);
view = preferencesFx.getView();
view.getStyleClass().add("preference");
((DialogPane) view.getParent()).getChildren().remove(view);
stage = new Stage();
stage.initModality(Modality.APPLICATION_MODAL);
Scene scene = new Scene(view, 700, 400);
scene.getStylesheets().addAll("/theme.css", nightMode.get() ? "/theme.dark.css" : "/theme.light.css");
stage.setScene(scene);
}

/**
Expand All @@ -144,8 +151,8 @@ public void attachListeners() {
nightMode.addListener((observable, oldValue, newValue) -> {
ExamClock.getStage().getScene().getStylesheets().removeAll("/theme.dark.css", "/theme.light.css");
ExamClock.getStage().getScene().getStylesheets().add(newValue ? "/theme.dark.css" : "/theme.light.css");
preferencesFx.getView().getScene().getStylesheets().removeAll("/theme.dark.css", "/theme.light.css");
preferencesFx.getView().getScene().getStylesheets().addAll("/theme.css", nightMode.get() ? "/theme.dark.css" : "/theme.light.css");
view.getScene().getStylesheets().removeAll("/theme.dark.css", "/theme.light.css");
view.getScene().getStylesheets().addAll("/theme.css", nightMode.get() ? "/theme.dark.css" : "/theme.light.css");
});
}

Expand All @@ -155,7 +162,7 @@ public void attachListeners() {
* @param modal the modal
*/
public void show(boolean modal) {
preferencesFx.show(modal);
stage.show();
}

}

0 comments on commit 4309377

Please sign in to comment.