Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 679
Katleho Hadar Avatar asked Jan 04 '23 21:01

Katleho Hadar


1 Answers

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;
}
like image 60
InternetUnexplorer Avatar answered Jan 14 '23 16:01

InternetUnexplorer