Katleho Hadar
Katleho Hadar

Reputation: 210

How to change color on JFoenix's progress bar

I am trying to change the color of the progress-bar found on the JFoenix's library (http://www.jfoenix.com). I'm using Java and JavaFX, here is my sample css:

.progress-bar {
-fx-accent: #4059a9;}

It should work, but instead it disables the color.

With css enabled:

enter image description here

With css disabled (default color showing):

enter image description here

Upvotes: 4

Views: 2076

Answers (1)

InternetUnexplorer
InternetUnexplorer

Reputation: 623

It seems that your problem is caused by the background insets.

Add this to your stylesheet:

.jfx-progress-bar > .track, .jfx-progress-bar > .bar {
    -fx-background-radius: 0;
    -fx-background-insets: 0;
}

Now the styling works:

.jfx-progress-bar > .bar {
    -fx-background-color: red;
}

The background color may be messed up after doing this, you can fix it with this:

.jfx-progress-bar > .track {
    -fx-background-color: #E0E0E0;
}

Upvotes: 10

Related Questions