flamendless/Slab

MessageBox expands if there are more than one button

Closed this issue · 4 comments

Hi, I'm having a bit of a problem when I try to use the FileDialog to in "savefile" mode - the confirm overwrite dialog expands until it goes off the edge of the screen.
From trying to find the root cause, it seems to be every MessageBox, and it seems to only happen when the buttons are aligned to the bottom-right.

The specific issue is:
When I create a MessageBox with more than one button, the messagebox constantly expands, moving the buttons off the side of the screen (as seen in the below gif)
expand

I see this every time when I run love on https://github.com/maw3193/slab-test/tree/messagebox-multi-button.

This is on Ubuntu 21.04, running love 11.3, with Slab master as of September 14th (commit 938aea0)

Hi. Thanks for reporting this. I'll get this fixed as soon as i can.

Hi, this has been fixed now in the latest commit @maw3193

Please let me know if the patch breaks other things.

That works, thanks!

I'll have a look and see if anything else crops up.

It seems that there is regression with the patch. A simple

	Slab.BeginWindow("test", {
		Title = "Test",
	})
	Slab.Text("test")
	Slab.Button("test")
	Slab.Button("test test test")
	Slab.EndWindow()

will show the problem with the fix. If button width exceeds the window's width, the window's width should stretch as well to compensate for the space.

EDIT:
latest patch should fix this regression