0

I want to style the font of the CalendarTimeTextField Popup control using a CSS File.

The following entry doesn't work for me:

.CalendarTimeTextFieldSkin_popup {
     -fx-text-fill: white;
     -fx-font-style: italic;
 } 

Setting the font-type works, changing text color doesn't.

Thanks for supporting me GGK

  • The popup of course contains just the CalendarPicker, have you tried styling that directly? .CalendarPickerControlSkin { -fx-text-fill: white; -fx-font-style: italic; } – tbeernot Apr 10 '18 at 13:07
  • i did... `.CalendarPicker { -fx-text-fill: white; -fx-font-style: italic; } .CalendarPickerControlSkin { -fx-text-fill: white; -fx-font-style: italic; } .CalendarPickerControlSkin_popup { -fx-text-fill: white; -fx-font-style: italic; } .CalendarTimeTextFieldSkin_popup { -fx-text-fill: white; -fx-font-style: italic; } .CalendarTimePickerSkin_popup .timeLabel { -fx-text-fill: white; -fx-font-style: italic; }`...but nothing changed – GGK stands for Ukraine Apr 10 '18 at 14:47
  • looks like (https://picload.org/view/dawoaori/10-04-_2018_16-51-55.jpg.html) – GGK stands for Ukraine Apr 10 '18 at 14:53
  • Ahhhh, that text is from the TimePicker! https://github.com/JFXtras/jfxtras/blob/9.0/jfxtras-controls/src/main/resources/jfxtras/internal/scene/control/CalendarTimePicker.css – tbeernot Apr 11 '18 at 04:18
  • `.CalendarTimePickerSkin { -fx-text-fill: white; -fx-font-style: italic; }` sets the font italic...but colore won't change. Probably styling the font color isn't possible? – GGK stands for Ukraine Apr 11 '18 at 05:34
  • I'm a bit busy ATM. Unfortunately JavaFX does not have such a nice CSS application-tree as browsers do. But the text is rendered with a Text node (https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#text) and if I search on the web ()https://docs.oracle.com/javafx/2/text/jfxpub-text.htm) I see that -fx-stroke: black; is used. Give that a try. – tbeernot Apr 16 '18 at 04:18
  • Thanks a lot. That's exactly what I'm looking for. Now I set following code...and it works. `.CalendarTimePickerSkin .timeLabel { -fx-font-family: "Segoe UI Semibold"; -fx-font-size: 15pt; -fx-fill: white; }` – GGK stands for Ukraine Apr 17 '18 at 06:45

1 Answers1

0

The text is rendered with a Text node (https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#text) so use -fx-fill and/or -fx-stroke.

tbeernot
  • 2,473
  • 4
  • 24
  • 31