Don't decide whenever widen device controls panel before parent properly determines its dimensions

This commit is contained in:
DBotThePony 2025-02-17 19:47:54 +07:00
parent 6105328e85
commit 1f9719ceab
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -353,8 +353,10 @@ class DeviceControls<out S : MatteryScreen<*>>(
var totalWidth = 0f
var totalHeight = 0f
val parent = parent!!
for (button in buttons) {
if (y != 0f && button.height + y > parent!!.height) {
if (y != 0f && button.height + y > parent.height && (parent.dock == Dock.NONE || !parent.layoutInvalidated)) {
totalHeight = totalHeight.coerceAtLeast(y - 2f)
y = 0f
x += currentWidth + 2f