This how my bottom view is. How to alighn the prog...
# tornadofx
m
This how my bottom view is. How to alighn the progress bar to the far right of the hbox?
bottom = hbox {
label(controller.statusToView) {
padding = insets(horizontal = 3)
}
//button { text = "stop" }
progressbar(status.progress).apply {
visibleWhen { status.running }}
}
a
Try putting this inside the label block:
Copy code
hboxConstraints {
    hgrow = Priority.SOMETIMES
}
m
It made it like this
Played around a bit with no luck.
bottom = hbox {
label(controller.statusToView) {
alignment = Pos.CENTER_LEFT
padding = insets(horizontal = 3, vertical = 0)
}
//button { text = "stop" }
progressbar(status.progress) {
alignment = Pos.CENTER_RIGHT
padding = insets(horizontal = 3, vertical = 0)
visibleWhen { status.running }}
}
c
Try putting a pane between them, and set the hgrow on that instead
👍 2
m
That did the trick.
bottom = hbox {
label(controller.statusToView) {
padding = insets(horizontal = 3, vertical = 0)
}
pane{
hgrow = Priority.SOMETIMES
}
progressbar(status.progress) {
padding = insets(horizontal = 3, vertical = 0)
visibleWhen { status.running }}
}
m
tornadofx also has a "spacer" that will expand to fill up space