-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Label/widget layout combinaisons #395
Comments
This thread isn't specifically about checkboxes though - it's about the option for all (or most) of the controls to have the label on the left side. (like the group label (third box of third answer by DA01 in the thread you linked) Basically a simple way to mimic an HTML table with tr, th (?), td where the first column contains the labels (or anything really, depending on which direction Omar wants to take it) and the next the widget (or multiples with sameline or even more TDs would help. ImGui::Group can be used as long as all the widgets have the same height, but that's rarely the case I find. :) Child windows can work too, but it's tricky to keep them scrolled in sync etc. |
FYI I had a stash with a prototype of that working but there was some unsolved problems. The stash was hard to merge. One problem was the worry that people are tempted by blindly adopti Label-Widget without thinking twice, whereas Widget-Label has many advantages. It isn't a priority but I would like to resume that work later. |
Although there are arguable merits for l/w or w/l, sometimes you are implementing a design by a designer, and I think in that common case we programmers have to abuse columns and patch widgets as necessary to make them not reserve space for a label. I would like to not have to do that any more :) |
Columns are very weak at the moment, sorry. Will work on improving all those things. It would allow quick combinations of TextClipped() (with given width) + SameLine + Widget to be locally used when for some reason columns are not practical (perhaps for single items, interleaved with non-columned items - merging cells? etc.) |
Any progress on this? |
Not yet.! |
Is it possible to hide labels? That may be a quicker enhancement to do that doesn't require much extra coding. For example, I have an input box and I use a colored text element before the box, now all I need to do is hide the label the box displays. |
Please read the FAQ.
|
Beautiful! Thanks!! |
Followup on what I mentioned in #259
I'll try to be working on that next. If you have any feedback/idea.
Note this only concern layout within the simple "big" widgets that are typically composed of a title and a frame with content edition.
If we have a "label - widget" label it assume that label is contained within a given width. There are times where you may want to omit the label and keep the extra spacing on the left side, but if you are trying to fit multiple widgets on a sameline the space wouldn't make sense.
One easy way I thought we could allow for both case would be to consider than an empty visible label, e.g. "" or "##hiddenstuff" would ignore the extra spacing on the left-side, but a single space label e.g. " " or " ##hiddenstuff" would keep that spacing on the left-side.
Other desirable features:
The text was updated successfully, but these errors were encountered: