mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-19 08:47:57 +07:00
Small File Chooser and Separator fixes (#9496)
* Fix FileChooser click-behind * Fix separators not allowing a Table to shrink back when other cells change width
This commit is contained in:
parent
a7107fa04d
commit
00712e49a8
@ -123,6 +123,7 @@ open class FileChooser(
|
||||
|
||||
init {
|
||||
innerTable.top().left()
|
||||
innerTable.touchable = Touchable.enabled
|
||||
|
||||
fileList.selection.setProgrammaticChangeEvents(false)
|
||||
fileNameInput.setTextFieldListener { textField, _ -> result = textField.text }
|
||||
|
@ -428,9 +428,9 @@ fun Group.addBorderAllowOpacity(size:Float, color: Color): Group {
|
||||
|
||||
|
||||
/** get background Image for a new separator */
|
||||
private fun getSeparatorImage(color: Color) = ImageGetter.getDot(
|
||||
private fun getSeparatorImage(color: Color) = Image(ImageGetter.getWhiteDotDrawable().tint(
|
||||
if (color.a != 0f) color else BaseScreen.skin.getColor("color") //0x334d80
|
||||
)
|
||||
))
|
||||
|
||||
/**
|
||||
* Create a horizontal separator as an empty Container with a colored background.
|
||||
@ -441,7 +441,7 @@ fun Table.addSeparator(color: Color = Color.WHITE, colSpan: Int = 0, height: Flo
|
||||
val separator = getSeparatorImage(color)
|
||||
val cell = add(separator)
|
||||
.colspan(if (colSpan == 0) columns else colSpan)
|
||||
.minHeight(height).fillX()
|
||||
.height(height).fillX()
|
||||
row()
|
||||
return cell
|
||||
}
|
||||
|
@ -172,6 +172,7 @@ object ImageGetter {
|
||||
}
|
||||
|
||||
fun getWhiteDot() = getImage(whiteDotLocation).apply { setSize(1f) }
|
||||
fun getWhiteDotDrawable() = textureRegionDrawables[whiteDotLocation]!!
|
||||
fun getDot(dotColor: Color) = getWhiteDot().apply { color = dotColor }
|
||||
|
||||
fun getExternalImage(fileName: String): Image {
|
||||
|
Loading…
Reference in New Issue
Block a user