mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-16 19:11:13 +00:00
[Demo] Selectable covering Button on the same line, is this by design? #6574
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#6574
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?
Version/Branch of Dear ImGui:
Version: 1.89.7
Branch: features/range_select
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler: MSVC 19.36.32535
Operating System: Windows 11 22H2
My Issue/Question:
Is this by design?
EX: I didn't find any API that can change the z-order of widgets, maybe some related APIs should be added
Screenshots/Video
Standalone, minimal, complete and verifiable example:
Hard to say without any code, but it seems you have
ImGuiTreeNodeFlags_SpanAvailWidthactive. Using the available with is the purpose of that flag.Edit: ah, those leaves are selectables in the demo code. But in the demo code they just have text after them, in that case an expanded selectable would be desired. The buttons are your addition, you would have to adjust the selectables accordingly.
You need to call
SetNextItemAllowOverlapto explicitly enable support for overlapping widgets.IE:
This is a new API, I didn't understand what it did at first, thanks for the answer!
Thank you for pointing this out.
Actually I think it was a mistake that I committed it in range_select branch, I recall it was a test and I didn't finish the thing.
I will rework this section so the button look the right size + use
SetNextItemAllowOverlap()here and there.I have pushed
9a15730with some use of SetNextItemAllowOverlap() in the demo.