Hello. I have in my main window a borderpane, wher...
# tornadofx
t
Hello. I have in my main window a borderpane, where left is for navigation und in center are the subviews. I load this center views with replace the center.root and use ViewTransition.Slide(0.5.seconds, ViewTransition.Direction.LEFT). That works. But the transition slides over the scene and not only over the replaced subview. Is there an easy way to do it only over the center of the borderpane. Thanks for help.
v
Perhaps, you may want to look at `Fragment`s? I dunno (have not tested it myself), but it seems, that
Fragments
are also able to slide, since they are `tornadofx.UIComponent`s and also have
replaceWith
function
You can add a
Fragment
into your app as
Copy code
val slideFragment = find(FirstSlideFragment::class)
borderpane {
  center {
    add(slideFragment)
  }
}
...
slideFragment.replaceWith(SecondSlideFragment::class, ViewTransition.Slide(0.5.seconds, ViewTransilition.Direction.LEFT))
t
Thankyou Vladimir. Your example works for sliding too. But my problem that it slides over the scene (that means also over the navigation part) is the same as with using view. Its not a big problem but it bothered me in my aesthetical feeling.
v
Oh, I hope, that Carl's solution works