Skip to content
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

Merged
merged 5 commits into from Oct 30, 2019

Conversation

ShuTingY
Copy link
Collaborator

@ShuTingY ShuTingY commented Oct 29, 2019

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

Comment on lines +32 to +52
/* 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);

*/
Copy link
Collaborator

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

Comment on lines 19 to 28
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));
}
Copy link
Collaborator

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

@ShuTingY ShuTingY merged commit e0c79ea into AY1920S1-CS2103T-T12-4:master Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GUI change theme feature
2 participants