Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

SmartListCell clears styleClass #1071

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/main/java/tornadofx/ListView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,7 @@ open class SmartListCell<T>(val scope: Scope = FX.defaultScope, listView: ListVi
super.updateItem(item, empty)

if (item == null || empty) {
textProperty().unbind()
graphicProperty().unbind()
text = null
graphic = null
style = null
cleanUp()
clearCellFragment()
} else {
FX.ignoreParentBuilder = Once
Expand All @@ -170,6 +166,15 @@ open class SmartListCell<T>(val scope: Scope = FX.defaultScope, listView: ListVi
}
}

private fun cleanUp() {
textProperty().unbind()
graphicProperty().unbind()
text = null
graphic = null
style = null
styleClass.clear()
}

private fun clearCellFragment() {
cellFragment?.apply {
cellProperty.value = null
Expand Down