Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout Columns issue with heights #121

Open
flamendless opened this issue Jan 7, 2022 · 0 comments
Open

Layout Columns issue with heights #121

flamendless opened this issue Jan 7, 2022 · 0 comments

Comments

@flamendless
Copy link
Owner

flamendless commented Jan 7, 2022

Code snippet below:

	Slab.BeginWindow("sample", {Title = "Sample", W = 640, AutoSizeWindow = false})
	Slab.BeginLayout("layout", {
		Columns = 2,
		ExpandW = true,
		AlignX = "center",
		AlignRowY = "center",
	})
	for k, v in pairs(test) do
		Slab.SetLayoutColumn(1)
		Slab.Text(k)
		Slab.SetLayoutColumn(2)
		if Slab.Button("up") then
		end
		Slab.SameLine()
		if Slab.Button("down") then
		end
	end
	Slab.EndLayout()
	Slab.EndWindow()

shows
image


DearImGui solves this by allowing SmallButton which takes the same height as font (i assume) so it would be equal to the height of the text.

Another solution I can think of is to make layout columns use the max height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant