mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
ImGui::Separator() ignores grouping #205
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#205
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
You can see on the attached

screenshot that separator intersects image on the left, code to reproduce:
Hmm- The problem is that even though I can fix it for the left side, at the point where you are calling Separator the group is still growing and doesn't have a known width. So the fix will not cover every case evenly. Perhaps later on BeginGroup() can take size and function as a small subset of BeginChild to cover this sort of thing.
Yeah, or add size parameter to separator itself.
I have committed the above because I think it is more correct, it should fix your use case.
However I need to add new parameters and variants to Separator() to cover more cases. We have a similar open issue with Columns(), and there is also the fact the Separator() by default draw but do not "register" its size back into the layout. This is desirable by default, but If a size is explicitly passed it should probably register it. I'll keep this bug open until I can come up with answers to those various problems.
OK, also there are similar issues with other widgets, for example:
looks like this:

What is the issue here?
Combo box are meant to display outside of the parent window. You can resize them using PushItemWidth/PopItemWidth.
Btw for this sort of situation you can call ImGui::AlignFirstTextHeightToWidgets() prior to Text to vertically align the Status text downward. Later on you'll be able to use Label-Widget configuration instead of Widget-Label so it will be made easier.
Yes, thank you, ImGui::AlignFirstTextHeightToWidgets() helped with vertical alignment (what's interesting is that I didn't noticed that issue before).
What I referenced to is combobox automatic width calculation - I fixed it by commenting out this lines:
and adding window->ItemWidthDefault = -1; instead in ImGui::Begin, so now ImGui::CalcItemWidth() returns valid value and we can see combobox'es down arrow inside the window:
it's not a bug here. The default behaviour for big widget is to take 65% of the width.
You can use PushItemWidth(-1) to always align to right side if you don't have a label.
Yeah, but why not 55% or 70%? ;-) I mean, why not auto-size items by it's content, 'cos right now I write something like this:
The default behavior is that we want all widgets to be aligned with each other so we have the same width, and ImGui at the moment by default uses a "widget -- label" scheme which was chosen to minimize the need for clipping rectangles.
I am not sure to understand what you are trying to do. If you wanted the combo box to be the size or your "Watched" string then it would change size every time you select another value (e.g. "Want to Watch"), which would look odd and possibly mess up with layout. I've never seen a combo box behave like that with a standard widget system. It's possible as you are showing but not sure why you are doing that.
If you want to achieve what's in the picture above, aka align the combo to the right size of the window, then you can do
This will later be made easier as a I refactor the widget "layouts" options to allow for multiple settings including "label (single space) widget".
Closing this issue as mostly sanitized/standardized now.
You're truly a hero for still remembering & working on an issue nearly a decade ago. I do freelancing and i use imgui for most of my GUI, i love to donate for your work but i unfortunately can't aford it because i live in a poor country and even 5 American Dollar can feed my family for 5 days.
All i can do is wish you do well, have lots of health and be successful on your carreer. Omar - not the hero we deserve, but the hero we need!