forked from j62/ctbrec
Show restart message, when colors are changed
This commit is contained in:
parent
3bfb76e441
commit
a6be8b4b63
|
@ -16,7 +16,7 @@ public class ColorSettingsPane extends Pane {
|
|||
Button reset = new Button("Reset");
|
||||
Pane foobar = new Pane();
|
||||
|
||||
public ColorSettingsPane() {
|
||||
public ColorSettingsPane(SettingsTab settingsTab) {
|
||||
getChildren().add(labelBaseColor);
|
||||
getChildren().add(baseColor);
|
||||
getChildren().add(labelAccentColor);
|
||||
|
@ -26,13 +26,20 @@ public class ColorSettingsPane extends Pane {
|
|||
baseColor.setValue(Color.web(Config.getInstance().getSettings().colorBase));
|
||||
accentColor.setValue(Color.web(Config.getInstance().getSettings().colorAccent));
|
||||
|
||||
baseColor.setOnAction(evt -> Config.getInstance().getSettings().colorBase = toWeb(baseColor.getValue()));
|
||||
accentColor.setOnAction(evt -> Config.getInstance().getSettings().colorAccent = toWeb(accentColor.getValue()));
|
||||
baseColor.setOnAction(evt -> {
|
||||
Config.getInstance().getSettings().colorBase = toWeb(baseColor.getValue());
|
||||
settingsTab.showRestartRequired();
|
||||
});
|
||||
accentColor.setOnAction(evt -> {
|
||||
Config.getInstance().getSettings().colorAccent = toWeb(accentColor.getValue());
|
||||
settingsTab.showRestartRequired();
|
||||
});
|
||||
reset.setOnAction(evt -> {
|
||||
baseColor.setValue(Color.WHITE);
|
||||
Config.getInstance().getSettings().colorBase = toWeb(Color.WHITE);
|
||||
accentColor.setValue(Color.WHITE);
|
||||
Config.getInstance().getSettings().colorAccent = toWeb(Color.WHITE);
|
||||
settingsTab.showRestartRequired();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
|
||||
l = new Label("Colors");
|
||||
layout.add(l, 0, row);
|
||||
ColorSettingsPane colorSettingsPane = new ColorSettingsPane();
|
||||
ColorSettingsPane colorSettingsPane = new ColorSettingsPane(this);
|
||||
layout.add(colorSettingsPane, 1, row++);
|
||||
GridPane.setMargin(l, new Insets(0, 0, 0, 0));
|
||||
GridPane.setMargin(colorSettingsPane, new Insets(CHECKBOX_MARGIN, 0, 0, CHECKBOX_MARGIN));
|
||||
|
|
Loading…
Reference in New Issue