B4J Question Listview Selected Focus Color

Douglas Farias

Expert
Licensed User
Longtime User
Hi all
How can i change this color blue to red?


I have try with css
HTML:
.list-view {
  -fx-font: bold 16pt "Comic Sans MS";
  -fx-background-color: red;

}

.list-view:focused {
  -fx-background-color: red;

}

.list-cell {
  -fx-background-color: red;
}

but this change only the background and now the selected rows like this image, how can i change this blue effect to red?
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Caspain CSS use a little bit more of CSS


.list-view:focused .list-cell:focused {-fx-background-color:-fx-focus-color,-fx-cell-focus-inner-border,-fx-control-inner-background;-fx-background-insets:0,1,2;}

.list-view:focused .list-cell:focuseddd {-fx-background-color:-fx-focus-color,-fx-cell-focus-inner-border, derive(-fx-control-inner-background,-5%);-fx-background-insets:0,1,2;}

/* When the list-cell is selected and focused */.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;}

.list-view:focused .list-cell:filled:selected,.list-view:focused .list-cell:filled:selected:hover {-fx-background:-fx-accent;-fx-background-color:-fx-selection-bar;-fx-text-fill:-fx-selection-bar-text;}

.list-view:focused .list-cell:filled:focused:selected:hover {-fx-background:-fx-accent;-fx-background-color:-fx-focus-color,-fx-cell-focus-inner-border,-fx-selection-bar;-fx-background-insets:0,1,2;-fx-text-fill:-fx-selection-bar-text;}
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
really big css xD
but where chance the color on this
the native blue like the image om 1° post to red
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

try this CSS style = tested on a standard listview.

B4X:
.list-cell:selected {
  -fx-background-color: red;
}
To change the text color as well, add
B4X:
  -fx-text-fill: white;
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…