I have a ListView and want the following:

  • Odd rows with white background color;
  • ListView: when mouse over an item, highlight with a blue shade;
  • ListView: when an item is selected, paint it with a gradient;
  • ListView: when focus is lost from ListView, selected item should be painted with gradient;
  • ListView: all items will start with text-fill black. But on mouse over and/or selected it will change to white.

That's my code. It's working fine, except for the even rows: on mouse over, it highlight in white. So, the text's white and can't be showed. What's wrong with it?

.list-cell:filled:selected:focused, .list-cell:filled:selected {
    -fx-background-color: linear-gradient(#328BDB 0%, #207BCF 25%, #1973C9 75%, #0A65BF 100%);
    -fx-text-fill: white;
}

.list-cell:odd {
    -fx-cell-hover-color: #0093ff;
    -fx-background-color: white;
}

.list-cell:filled:hover {
    -fx-cell-hover-color: #0093ff;
    -fx-text-fill: white;
}

Thanks in advance.

Edit
Report