Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional parameter to ImGui::Separator for user-defined vertical or horizontal separator #8321

Open
jnyfah opened this issue Jan 14, 2025 · 1 comment
Labels

Comments

@jnyfah
Copy link

jnyfah commented Jan 14, 2025

Version/Branch of Dear ImGui:

Version 1.91.7, Branch: master

Back-ends:

imgui_impl_XXX.cpp + imgui_impl_XXX.cpp

Compiler, OS:

Windows 11 + MSVC 2022

Full config/build information:

No response

Details:

My Issue/Question:

Currently, ImGui::Separator only supports horizontal separators by default. Internally, IMGUI does support vertical separators via the ImGuiSeparatorFlags_Vertical flag, but this functionality is not exposed to users.

I want to fix this by allowing users to explicitly create vertical separators by adding an optional parameter to ImGui::Separator. This would make it easier to create custom layouts that require vertical separators.

After checking the code, I noticed that ImGuiSeparatorFlags and ImGuiLayoutType_ are used internally, but ImGuiLayoutType_ is marked as "in development" and isn't exposed publicly. I’m unsure whether exposing ImGuiLayoutType_ directly would be acceptable or if a new public enum should be introduced for this purpose.

Would exposing a new enum or flag for user-defined separators be an acceptable approach? I'd like to get feedback before proceeding with implementation. Thanks!

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();
@jnyfah jnyfah changed the title Add optional parameter to ImGui::Separator for user-defined vertical or horizontal separator" Add optional parameter to ImGui::Separator for user-defined vertical or horizontal separator Jan 14, 2025
@ocornut
Copy link
Owner

ocornut commented Jan 16, 2025

Hello Jennifer,

This still needs to be designed, and unfortunately answering your question would constitute part of the work.
It could be quite ambiguous what a vertical separator means, depending on context. What is your precise usage context?
Presently it is de-facto supported inside menu-bar which have a fixed height and a tendency to be single line layout.

For now, could you call SeparatorEx(ImGuiSeparatorFlags_Vertical) using imgui_internal.h ?

Also linking to #7360, #319, #97. That last one is one of our oldest open issue. I'm going to unlock it as part of a wider refactor of layout system.

@ocornut ocornut added the layout label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants