Back-ends: imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp
Compiler: Apple clang version 12.0.5 (clang-1205.0.22.11)
Operating System: MacOS
My Issue/Question:
I would like to be able to double click the dock splitter to move it to the middle. I tried implementing it in SplitterBehavior, but I am a bit confused; I added ImGuiButtonFlags_PressedOnDoubleClick to the flags in ButtonBehavior so that it reacts to double clicks, but then when calculating the mouse delta in the code:
on the next frame it becomes large since bb_interact.Min was modified, but the g.IO.MousePos is the same, while following the pressed result from ButtonBehavior, we receive a held event. I also tried disabling resizing by dragging altogether, but somehow, if I condition on pressed, the splitter moves for one frame to the correct position, and then goes back, so this needs to be done over 2 frames?
Anyway, if you could either add this behavior or give me some hints on how to implement it myself, I would be grateful.
I was finally able to implement a solution by modifying DockNodeTreeUpdateSplitter and SplitterBehavior slightly. Let me know if you think it's useful to make a pull request.
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp Compiler: Apple clang version 12.0.5 (clang-1205.0.22.11) Operating System: MacOS
My Issue/Question:
I would like to be able to double click the dock splitter to move it to the middle. I tried implementing it in
SplitterBehavior
, but I am a bit confused; I addedImGuiButtonFlags_PressedOnDoubleClick
to the flags inButtonBehavior
so that it reacts to double clicks, but then when calculating the mouse delta in the code:on the next frame it becomes large since
bb_interact.Min
was modified, but theg.IO.MousePos
is the same, while following thepressed
result fromButtonBehavior
, we receive aheld
event. I also tried disabling resizing by dragging altogether, but somehow, if I condition onpressed
, the splitter moves for one frame to the correct position, and then goes back, so this needs to be done over 2 frames?Anyway, if you could either add this behavior or give me some hints on how to implement it myself, I would be grateful.