You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to include the RichtTextFX CodeArea into my TornadoFX project. Showing it works fine. But setting a style class with codeArea.setStyleClass(0, codeArea.length, "command") doesn't apply my css.
When I check if the class was set with println(codeArea.getStyleAtPosition(codeArea.length / 2)) I get the expected output [command].
My CSS class is defined using the TornadoFX Type-Safe CSS functionality:
classKeywords: Stylesheet() {
companionobject {
val command by cssclass()
}
init {
command {
fill =Color.RED
fontSize =40.px
fontWeight =FontWeight.BOLD
}
}
}
My MainView:
classMainView: View("Test") {
var codeArea:CodeArea by singleAssign()
val controller: mainController by inject()
overrideval root = borderpane {
top = text("Test") {
addClass(Keywords.command)
}
codeArea =CodeArea()
codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea))
codeArea.richChanges().subscribe { change ->
codeArea.setStyleClass(0, codeArea.length, "command")
println(codeArea.getStyleAtPosition(codeArea.length /2))
//codeArea.setStyleSpans(0, controller.computeHighlighting(codeArea.text))
}
center = codeArea
}
}
The text Test showes up as expected with the red color and huge font size.
Does anybody know, how I can apply the CSS properly?
The text was updated successfully, but these errors were encountered:
I want to include the RichtTextFX CodeArea into my TornadoFX project. Showing it works fine. But setting a style class with
codeArea.setStyleClass(0, codeArea.length, "command")
doesn't apply my css.When I check if the class was set with
println(codeArea.getStyleAtPosition(codeArea.length / 2))
I get the expected output[command]
.My CSS class is defined using the TornadoFX Type-Safe CSS functionality:
My MainView:
The text
Test
showes up as expected with the red color and huge font size.Does anybody know, how I can apply the CSS properly?
The text was updated successfully, but these errors were encountered: