css - JavaFX - styling an unfocused ListView row -


I'm trying to styling a selected, uncompressed list view row with a different color (say gray). It proved useful to me, but it lacks a very useful behavior, but there is a lack of necessary behavior to fill the selection in color.

  / * 1. Strange rows with white background colors; 2. List view: When there is a mouse on an item, highlight it with blue shadow; 3. List view: When an item is selected, paint it with a shield; 4. List view: When the focus is lost from the list event, the selected item should be painted with a gradient; 5. List view: All items filling text will start with black. But on mouse and / or when selected it will turn into white. * / .list-cell: fill: selected: focus, .list-cell: filled: selected {/ * 3:, 4: * / -fx- Background color: linear-gradient (# 333 0%, # 777 25% , #aaa 75%, #EEe100%); -fx-text-fill: white; / * 5 * /} .list-cell {-fx-text-fill: black; / * 5 *.} .list-cell: Strange {-fx-background-color: white; / * 1 * /} .list-cell: Even {-fx-background-color: # 8f8; / * For information * /} .list-cell: fill: hover {-fx-background-color: # 00f; / * 2 * / -fx-text-fill: white; / * 5 * /}  

Meaning, how did the comment # 4 be applied? Thank you.

The way in which a list-cell is selected and not in focus, the focus of the lost focus Keep in mind that each CSS class should be created for one including the CSS selector (list-view) of the listview. Room: Filled: Selected {/ 4: (Styling) when Focus Out) * / -fx-background-color: Linear-Slope (# 333 0%, # 777 25%, #aaa 75%, # EEe 100%); -fx-text-fill: white; }. List View: Focus. List-cell: Fill: selected {/ * 3: (This is more specific and therefore overrides the above) * / -fx-background-color: Linear shield (# 300 0%, # 700 25%, # a00 75 %, # E00 100%); }


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -