ListView Row Color
Hi,
I have a LisView with a Cell Factory set. The cell factory changes the text color based on some flags for each row (black, red, green, blue, etc.)
When I select a row I want to change the color of the text to always be WHITE regardless of the original color of the text. This is because some of the text colors (such as red and blue ) don't look good with the default -fx-selection-bar color.
I added the following CSS snippet to my list view.
.list-view:focused .list-cell:filled:focused:selected
{
-fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar;
-fx-background-insets: 0, 1, 2;
-fx-background: -fx-accent;
-fx-text-fill: -fx-selection-bar-text;
}
It works fine, but it doesn't return the text to it's original color when the selection is changed from one row to another.
Is there a proper way to do this?
Thanks.