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

Combo: combo widget in table is sized incorrectly #566

Closed
gucio321 opened this issue Oct 8, 2022 · 4 comments · Fixed by #628
Closed

Combo: combo widget in table is sized incorrectly #566

gucio321 opened this issue Oct 8, 2022 · 4 comments · Fixed by #628
Labels
bug Something isn't working

Comments

@gucio321
Copy link
Collaborator

gucio321 commented Oct 8, 2022

What happend?

I'm putting ComboWidget inside the table cell. I've noticed that width of the widget is incorrect (much smaller than the column)

image

Calling .Size(giu.Auto) doesn't help (it did for InputText widget)

Code example

main.go
package main

import "github.com/AllenDang/giu"

var (
	value int32
	list  []string = []string{"1", "2", "3"}
)

func loop() {
	giu.SingleWindow().Layout(
		giu.Table().Columns(
			giu.TableColumn("Column 1"),
			giu.TableColumn("Column 2"),
		).Rows(
			giu.TableRow(
				giu.Combo("##my combo", list[value], list, &value),
				giu.Label("<- why is there so large padding?"),
			),
		),
	)
}

func main() {
	wnd := giu.NewMasterWindow("X padding in table cells [issue]", 640, 480, 0)
	wnd.Run(loop)
}

To Reproduce

  1. Run my demo
  2. you'll see the bug described above

Version

master

OS

Fedora 36

@gucio321 gucio321 added the bug Something isn't working label Oct 8, 2022
@AllenDang
Copy link
Owner

@gucio321 It's really strange. Combo's width even doesn't work when it's not in table. Might be a bug inside imgui.

@gucio321 gucio321 added the External Issue Issue in dependencies - can't make progress in giu yet. label May 9, 2023
@gucio321
Copy link
Collaborator Author

gucio321 commented May 9, 2023

@AllenDang I didn't test in tables but they work now in normal conditions perfectly in plain cimgui:

           ImVec2* size = new ImVec2(200, 80);
            if (ImGui::Button("I'm 100 size", *size)) {}

            int currentItem;
            ImGui::PushItemWidth(200);
            if (ImGui::Combo("##combo", &currentItem, "item0i", 2)) {}
            ImGui::PopItemWidth();

image

@AllenDang
Copy link
Owner

@gucio321 Seems it's a upstream issue and has been solved.

@gucio321
Copy link
Collaborator Author

ok, so I think this needs to wait for migration #628

@gucio321 gucio321 removed the External Issue Issue in dependencies - can't make progress in giu yet. label May 10, 2023
@gucio321 gucio321 linked a pull request May 10, 2023 that will close this issue
69 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants