Open tpecholt opened 1 year ago
Hello,
I am not sure I remember if there was a good reason.
Selectable() has various sizing subtleties (some I wish I didn't had), but the extra padding it adds would make the use of CalcItemSize()
misleading. e.g. if you use -FLT_MIN (or -1) to right-align it would still add half ItemSpacing.x*0.5f over this, making the thing looks unaligned.
If I have to be honest, removing this extra padding from Selectable() would be a great move but it'll require carefull maneuvering and documentation.
I see what you mean. It looks like Selectable frame gets extended but unless it's hovered or pressed the extension is not visible and the label stays aligned with other -1 widgets on the next line. Also there is NoPadWithHalfSpacing to disable this behavior. So to me enabling negative size would still make sense but feel free to close this ticket how you wish.
I'll leave it open for now. I might introduce support for this sooner but most I want to eventually remove that extra padding.
Version/Branch of Dear ImGui:
Version: 1.90 Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp Compiler: VS 2022 Operating System: Windows 10
My Issue/Question: Selectable currently doesn't honor negative size values so its size can't be made relative to right or bottom edge of the window. I am currently calling
CalcItemSize
in place of the size parameter to fix it but that is inconsistent with how other widgets work (InputTextMultiline, Child, Table).Screenshots/Video
Standalone, minimal, complete and verifiable example: