From 101b3f0dd9e6eff46e520e2c8e8025932d7347c9 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Tue, 1 Nov 2016 17:14:39 +0100 Subject: [PATCH] Added color to TextNote name font --- SmartNotes/src/com/madeorsk/smartnotes/notes/TextNote.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SmartNotes/src/com/madeorsk/smartnotes/notes/TextNote.java b/SmartNotes/src/com/madeorsk/smartnotes/notes/TextNote.java index 6874eef..12c607b 100644 --- a/SmartNotes/src/com/madeorsk/smartnotes/notes/TextNote.java +++ b/SmartNotes/src/com/madeorsk/smartnotes/notes/TextNote.java @@ -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 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() {