JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

JFXPopup - CSS rules not working for list items

Open peteralien opened this issue 9 years ago • 1 comments

I'm having problems using CSS to change colors in a JFXPopup. I tried several combinations, but... no luck. I'm using jfoenix v1.7.0. Can anyone tell me how i change the items and the selected item in the JFXPopup list?

My code is as follows:

.jfx-popup-container { -fx-background-color: yellowgreen; }

.jfx-popup-container .jfx-list-view { -fx-background-color: aquamarine; -fx-pref-width: 70px; -fx-background-insets: 25 0 25 0; }

.jfx-popup-container .jfx-list-view .jfx-list-cell { -fx-background-color: orange; }

.jfx-popup-container .jfx-list-view .placeholder .label { -fx-text-fill: navy; }

.jfx-popup-container .jfx-list-view .jfx-list-cell .label:selected { -fx-text-fill: white; }

Many thanks.

peteralien avatar Aug 31 '17 18:08 peteralien

Hello, if the list view items are of type String, then you can use the following css:

.jfx-popup-container
{
    -fx-background-color: yellowgreen;
}

.jfx-popup-container .jfx-list-view
{
    -fx-background-color: transparent;
    -fx-pref-width: 70px;
    -fx-background-insets: 25 0 25 0;
}
.jfx-popup-container .jfx-list-view .jfx-list-cell
{
    -fx-background-color: orange;
}

.jfx-popup-container .jfx-list-view .jfx-list-cell .text
{
    -fx-fill: navy;
}

.jfx-popup-container .jfx-list-view .jfx-list-cell:selected .text
{
    -fx-fill: white;
}

.jfx-popup-container .jfx-list-view .jfx-list-cell:selected
{
    -fx-background-color: red;
}

as JFXListCell has be updated to be consistent with Java ListCell.

Regards,

jfoenixadmin avatar Sep 11 '17 08:09 jfoenixadmin