Popups get the ability to scroll only the content without the buttons (#9513)

* Popups get the ability to scroll only the content without the buttons

* Centralize LoadingPopup

* Split non-WorldScreenMenuPopup classes off from that file

* Linting
This commit is contained in:
SomeTroglodyte
2023-06-04 07:41:58 +02:00
committed by GitHub
parent b9a916e081
commit 8a024bf9fe
15 changed files with 213 additions and 92 deletions

View File

@ -47,7 +47,7 @@ open class FileChooser(
title: String?,
startFile: FileHandle? = null,
private val resultListener: ResultListener? = null
) : Popup(stageToShowOn, false) {
) : Popup(stageToShowOn, Scrollability.None) {
// config
var filter = FileFilter { true }
set(value) { field = value; resetList() }
@ -123,21 +123,20 @@ open class FileChooser(
init {
innerTable.top().left()
innerTable.touchable = Touchable.enabled
fileList.selection.setProgrammaticChangeEvents(false)
fileNameInput.setTextFieldListener { textField, _ -> result = textField.text }
if (title != null) {
addGoodSizedLabel(title).colspan(2).center().row()
innerTable.addSeparator(height = 1f)
addSeparator(height = 1f)
}
add(pathLabelWrapper).colspan(2).fillX().row()
innerTable.addSeparator(Color.GRAY, height = 1f)
addSeparator(Color.GRAY, height = 1f)
add(fileScroll).colspan(2).fill().row()
innerTable.addSeparator(height = 1f)
fileNameCell = innerTable.add().colspan(2).growX()
innerTable.row()
addSeparator(height = 1f)
fileNameCell = add().colspan(2).growX()
row()
addCloseButton("Cancel", KeyboardBinding.Cancel) {
reportResult(false)