Added color to TextNote name font

This commit is contained in:
Madeorsk 2016-11-01 17:14:39 +01:00
parent d68bd74617
commit 101b3f0dd9
1 changed files with 5 additions and 1 deletions

View File

@ -36,6 +36,8 @@ public class TextNote extends Note
VBox box = new VBox();
box.setFillWidth(true);
TextField nameField = new TextField();
HBox titleBox = new HBox();
{
titleBox.setPadding(new Insets(10, 0, 0, 0));
@ -66,6 +68,7 @@ public class TextNote extends Note
public void changed(ObservableValue<? extends NoteColor> ov, NoteColor oldValue, NoteColor newValue)
{
TextNote.this.setNoteColor(newValue);
nameField.setStyle("-fx-text-fill: rgb(" + newValue.getColor().getRed()*255 + "," + newValue.getColor().getGreen()*255 + "," + newValue.getColor().getBlue()*255 + ");");
explorer.requestSave(TextNote.this);
}
});
@ -73,10 +76,11 @@ public class TextNote extends Note
}
box.getChildren().add(titleBox);
TextField nameField = new TextField();
// NAME FIELD
{
nameField.setAlignment(Pos.CENTER);
nameField.setId("nameField");
nameField.setStyle("-fx-text-fill: rgb(" + this.getNoteColor().getColor().getRed()*255 + "," + this.getNoteColor().getColor().getGreen()*255 + "," + this.getNoteColor().getColor().getBlue()*255 + ");");
nameField.setText(this.getName());
nameField.textProperty().addListener(new ChangeListener<String>()
{