Skip to content

Commit e1cd595

Browse files
committed
fix: layout of audio menu is now correctly aligned regardless of volume, closes #1152
1 parent d94ff6d commit e1cd595

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

fxgl/src/main/kotlin/com/almasb/fxgl/app/scene/FXGLDefaultMenu.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -710,13 +710,12 @@ open class FXGLDefaultMenu(type: MenuType) : FXGLMenu(type) {
710710
val percentSound = getUIFactoryService().newText("")
711711
percentSound.textProperty().bind(sliderSound.valueProperty().multiply(100).asString("%.0f"))
712712

713-
val hboxMusic = HBox(15.0, textMusic, sliderMusic, percentMusic)
714-
val hboxSound = HBox(15.0, textSound, sliderSound, percentSound)
715-
716-
hboxMusic.alignment = Pos.CENTER_RIGHT
717-
hboxSound.alignment = Pos.CENTER_RIGHT
718-
719-
return MenuContent(hboxMusic, hboxSound)
713+
val gridPane = GridPane()
714+
gridPane.hgap = 15.0
715+
gridPane.addRow(0, textMusic, sliderMusic, percentMusic)
716+
gridPane.addRow(1, textSound, sliderSound, percentSound)
717+
718+
return MenuContent(gridPane)
720719
}
721720

722721
/**

0 commit comments

Comments
 (0)