-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Custom tab bar, and button in front of tabs. #5342
Comments
You can't currently customize the docking tab bar in this way. What I'd probably do is modify The button is specifically submitted here: Lines 15291 to 15298 in 250333d
Given your mockup I'm assuming you'd be disabling this button either way. It'd be easier to replace the button rather than disable it and add your own since disabling it entirely means you have to fiddle with the layout stuff in (If you want your logo button to appear everywhere you probably want to edit If you plan to disable the dock menu/collapse button everywhere else, set |
We have two mecanisms which could be eventually toward that:
|
@PathogenDavid This is interesting, I haven't tough of hijacking How would you do it to avoid changing the ImGui source directly (I keep it as a git submodule)? |
I'd recommend just doing a fork via GitHub and pointing your submodule to that instead. GitHub makes it pretty easy to keep it up to date with upstream: I can think of ways to avoid the fork using preprocessor shenanigans, but they'd be pretty brittle and I think they'd just be a needless source of confusion down the line. |
Would you be able to provide an example on how this would work in the context of a dockspace tab bar? This looks promising, but input is not working. ImGuiID dockspace_id = ImGui::GetID("DockSpace");
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags, window_class);
ImGuiDockNode* node = (ImGuiDockNode*)GImGui->DockContext.Nodes.GetVoidPtr(dockspace_id);
if (node && node->TabBar)
{
ImGui::TabItemEx(node->TabBar, "X", nullptr, ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder, nullptr);
ImGui::TabItemEx(node->TabBar, "Trailing", nullptr, ImGuiTabItemFlags_Trailing | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder, nullptr);
} I don't really see how I would use |
FYI I think you figured this out as per your post #5515 but to answer this: |
Version/Branch of Dear ImGui:
Version: 1.88
Branch: docking
Back-end/Renderer/Compiler/OS:
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler: Microsoft C++ compiler (CL.exe)
Operating System: Windows 10
My Issue/Question:
We are doing a UI overhaul on our internal game engine. The UI design folks came up with some pretty nice looking workspace tab bar design, but I have no idea how to implement it? We really like the default docking behavior of ImGui but we need a way to separate workspace. So what we want to do is, like unreal, having main workspace windows facilitating one workflow made up of multiple smaller tool windows.
My main question is how i style and draw this kind of menu bars, specifically, how do i get the red button in at the start of the bar and offset the tabs to make space for it?
I believe the rest of the style can be obtained with setting imgui style setting, but where should this be done?
The text was updated successfully, but these errors were encountered: