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

Commit

Permalink
fitToParentHeight/Width/Size as well as `fitToHeight/Width/Size(reg…
Browse files Browse the repository at this point in the history
…ion)` helpers (#519)
  • Loading branch information
Edvin Syse committed Oct 30, 2017
1 parent 031c907 commit a266dc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `alert` builder accepts optional owner parameter (https://github.com/edvin/tornadofx/issues/483)

### Additions
- `fitToParentHeight/Width/Size` as well as `fitToHeight/Width/Size(region)` helpers (https://github.com/edvin/tornadofx/pull/519)
- `beforeShutdown` allows you to register shutdown hooks
- `DataGridPaginator` component to help with pagination for `DataGrid`
- runAsync supports `daemon` parameter to control thread characteristics (https://github.com/edvin/tornadofx/pull/508)
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/tornadofx/Async.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ infix fun <T> Task<T>.ui(func: (T) -> Unit) = success(func)

infix fun <T> Task<T>.success(func: (T) -> Unit) = apply {
Platform.runLater {
setOnSucceeded { func(value) }
setOnSucceeded {
if (Platform.isFxApplicationThread()) {
func(value)
} else {
runLater {
func(value)
}
}
}
}
}

Expand Down

0 comments on commit a266dc4

Please sign in to comment.