Skip to content

Commit

Permalink
Update scene property to support Live Views (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvin Syse committed Oct 15, 2016
1 parent 53a2fa3 commit 2684460
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.

## [1.5.7-SNAPSHOT]

- View.replaceWith now updates scene property to support Live Views (https://github.com/edvin/tornadofx/issues/191)
- ViewModel bind return value is now optional to support eventually available items
- ViewModel detects changes to the source object and applies to the model counterpart automatically
- ViewModel `bind(autocommit = true) { .. }` option
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/tornadofx/Nodes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,9 @@ fun Node.replaceWith(replacement: Node, transition: ViewTransition? = null, onTr
throw IllegalArgumentException("Replacement scene root must be a Parent")
}

// Update scene property to support Live Views
replacement.uiComponent<UIComponent>()?.properties?.put("tornadofx.scene", scene)

if (transition != null) {
transition.call(this, replacement) {
scene.root = it as Parent
Expand Down

0 comments on commit 2684460

Please sign in to comment.