mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Sub menus overlaying each other #1086
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#1086
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?
So I have noticed that open sub-menus will kinda overlay on its parent menu, here's an example:
I looked around in ImGuiStyle and couldn't find anything that would let me change this, though I kinda imagine it might have something to do with my style where I changed the padding:
Is it possible to change the appearance/positioning of menus?
It is intentional and desirable because when you start being in situation where child menus needs to be on the LEFT of their parent because of lack of space on the right, it would become really hard to distinguish the order of menus.
(Note that Windows is doing the same)
Why would you like to change that in the first place?
That's a fair point. I probably don't have to change it then, but I think it looks weird to me because of the transparency. Maybe I can fix that myself in the style's colors; if there is a style color for the menu background of these? I only see
ImGuiCol_MenuBarBg, which I think is for the actual bar.This is a fair point that its look a little weird with transparency. The default theme is opaque there, it is using
ImGuiCol_PopupBg.(
ImGuiCol_PopupBgis also used by normal Popups so that overlap might be problematic depending on what your theme is trying to do. For 1.50 (and pretty much the only reason 1.50 is on hold, otherwise we are already at 95% of 1.50) I want to refactor some of the stylish enumerations and move the borders to the regular style structure so I might revamp that. )@codecat, I love the colors you are using !
Would you mind posting the color templates, please ?
Sure! It's worth noting I took this from some other issue here, but I don't remember which.. :)
thank you !!
[EDIT] That's funny, because the original colors are from my own theme :) And you did a clever job by changing them programmatically ! Thanks again !
Actually, I got that color inversion code from the same Github issue 🤔
@codecat I made a small change today to alter the overlap to use
ItemInnerSpacing.xinstead ofItemSpacing.x(with the default style that would make the overlap twice smaller).I think this would attenuate this issue a little bit. I noticed on your recent post that you are still using the same style so maybe that attenuation is enough to make this a non-problem?
If you can't updating Dear ImGui easily, you can test the change localy by changing the assignment in
FindBestWindowPosForPopup, changefloat horizontal_overlap = g.Style.ItemSpacing.x;to useg.Style.ItemInnerSpacing.xinstead.I am not sure else what to do and I am tempted to close this issue if you think this isn't a big problem.
In the future we may introduce a
MenuBgstyle field but I would like to wait for style 2.0 with color defaults redirection.Thanks, that would indeed help! Will be able to try it out tonight. It's been a while since I've seen this issue, partly because I don't have a lot of these overlapping submenus anymore. Feel free to close this issue if you want.
By the way, is there an issue for "style 2.0"? I'd love to read your plans for that!
Thanks, will close this then, always a bit of a relief to close something ;)
This is scattered around posts and personal notes. Too early/busy to make a proper write-up, hopefully things will move this year. I'm currently looking at DPI/scaling issues first.