New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
- adds change theme feature #153
Conversation
/* todo: gui version | ||
System.out.println(Main.class.getResourceAsStream("/images/Light.png")); | ||
Image light = new Image(Main.class.getResourceAsStream("/images/Light.png")); | ||
Image dark = new Image(Main.class.getResourceAsStream("/images/Dark.png")); | ||
System.out.println(light.getUrl()); | ||
ImageView iv = new ImageView(); | ||
AnchorPane an = new AnchorPane(); | ||
an.getChildren().add(iv); | ||
Scene scene = new Scene(an); | ||
Scene scene = new Scene(new ThemeWindow().getView()); | ||
Stage stage = new Stage(); | ||
stage.setTitle("Theme"); | ||
stage.show(); | ||
|
||
GuiSettings guiSettings = model.getGuiSettings(); | ||
GuiSettings newGuiSettings = new GuiSettings(guiSettings.getWindowWidth(), | ||
guiSettings.getWindowHeight(), guiSettings.getWindowCoordinates().x, | ||
guiSettings.getWindowCoordinates().y, styleSheet); | ||
model.setGuiSettings(newGuiSettings); | ||
|
||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to remove in the final release
if (trimedInput.equals("light")) { | ||
color = "black"; | ||
styleSheet = "view/LightTheme.css"; | ||
} else if (trimedInput.equals("dark")) { | ||
color = "white"; | ||
styleSheet = "view/DarkTheme.css"; | ||
} | ||
if (styleSheet.isEmpty()) { | ||
throw new ParseException(String.format(MESSAGE_INVALID_THEME)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rearranging the if conditions to handle exceptions first, and use else if
for the 3rd one for slightly better readability
Fixes #152
added a new light theme
added set theme command
theme light
/theme dark
/theme pink
refresh GUI when setThemeCommand executes
minor changes to the dark theme