mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Snackbar's color can be changed according to the message type
- load a separate css file to change the color - if the assignment failed, the snackbar prompt will be red, otherwise theme color #story[1278]
This commit is contained in:
@@ -101,9 +101,7 @@ public class ViewManager {
|
||||
System.exit(0);
|
||||
});
|
||||
|
||||
jfxSnackbar = new JFXSnackbar();
|
||||
decorator.getChildren().add(jfxSnackbar);
|
||||
jfxSnackbar.registerSnackbarContainer(decorator);
|
||||
jfxSnackbar = new JFXSnackbar(decorator);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -228,8 +226,16 @@ public class ViewManager {
|
||||
*
|
||||
* @param snackbarText text to be displayed.
|
||||
*/
|
||||
public void showSnackbar(String snackbarText) {
|
||||
jfxSnackbar.show(snackbarText, 1500);
|
||||
public void showSnackbar(String snackbarText, boolean isWarning) {
|
||||
if (isWarning) {
|
||||
decorator.getStylesheets()
|
||||
.add(getClass().getResource("/css/dialogs/Snackbar.css").toExternalForm());
|
||||
} else {
|
||||
if (decorator.getStylesheets().size() > 1) {
|
||||
decorator.getStylesheets().remove(1);
|
||||
}
|
||||
}
|
||||
jfxSnackbar.show(snackbarText, "fuck", 1500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user