I have a quick question. Is there a way to style t...
# tornadofx
n
I have a quick question. Is there a way to style the
bar
or
track
of a
progressbar
using inline styles. i've had success in the stylesheets, but i haven't figured out a way to do it inline though
r
Unfortunately not. With inline styles, JavaFX only applies rules to the exact component, and cannot have any sort of nested selector.
👍 1
n
Thank you @Ruckus!
👍 1
i just wanted to follow that up with one more question @Ruckus. so if i wanted to create a custom progress bar control that allowed a dev to specify the 2 colors used in the stripes (showed in pic) would there be a trivial solution or would i end up having to create my own control all together? i haven't been able to add colors selected by a dev into the
linear-gradient
that is specified inside the nested selector inside the stylesheet. thanks for your time man
r
You'd want to create your own control, and expose the two colors as properties. If you make them styleable properties, the user could set the colors in their own CSS.
n
ok thank you! really appreciate it 👍
r
No problem