-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Added Filter to ComboWidget #950
base: master
Are you sure you want to change the base?
Conversation
Widgets.go
Outdated
filter.Clear() | ||
} | ||
|
||
filter.DrawV("##Filter", -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might result in some strange behaviours when multiple things with this tag are drawn. Maybe use GenAutoID
here.
@@ -201,6 +205,9 @@ func Combo(label, previewValue string, items []string, selected *int32) *ComboWi | |||
selected: selected, | |||
flags: 0, | |||
width: 0, | |||
filter: false, | |||
filterWidget: imgui.NewEmptyTextFilter(), | |||
filterLabel: GenAutoID(""), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use GenAutoID("filter")
(because of internal mechanisms of GenAutoID this will reduce potential issues)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this makes the popup just rapidly grow for some reason.
In examples/imguidemo, there is a combo box with a filter. It sadly doesn't seem to exist currently, creating quite a false-promise. So, I went to the original imgui repo and took the code from there to create a
Filter
method on theComboWidget
, specifying if there should be a TextFilter when opening it.