How can we change the title background color of a docked window?
Version/Branch of Dear ImGui:
Version 1.91.5 WIP (19141), Branch: docking
Back-ends:
raylib with rlImGui
Compiler, OS:
Windows 10 + MSVC 2022
Full config/build information:
Dear ImGui 1.91.5 WIP (19141)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS
define: IMGUI_DISABLE_OBSOLETE_KEYIO
define: _WIN32
define: _WIN64
define: _MSC_VER=1939
define: _MSVC_LANG=201703
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_raylib
io.BackendRendererName: NULL
io.ConfigFlags: 0x00000080
DockingEnable
io.ConfigViewportsNoDecoration
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00000007
HasGamepad
HasMouseCursors
HasSetMousePos
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,1024
io.DisplaySize: 1280.00,800.00
io.DisplayFramebufferScale: 1.25,1.25
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00
Details:
I want to control the look of the header-like part of the window behind the tabs. I'd be interested in learning how to remove it outright, however I think it can't be done without hiding the tab bar entirely. The next best thing would be to change its color, so I do as in the attached example.
While this works as long as the windows are undocked, it doesn't work while they're docked. I assume it's because the equivalent area in docked mode corresponds to a different color other than TitleBg(...). However, I have iterated through every single ImGuiCol_(...) value and none of them show any changes; the title bar is always white (with a little line below, which I'd also be interested in changing) when unselected, grey when selected. So my question is:
How can we change the title bar's colors when docked?
Screenshots/Video:
https://github.com/user-attachments/assets/90d73e07-a848-4e5c-b0a8-e5d01a3594ac
Minimal, Complete and Verifiable Example code:
ImGui::PushStyleColor(ImGuiCol_TitleBg, ImVec4(1.0f, 0.5f, 0.5f, 1.0f));
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, ImVec4(1.0f, 0.0f, 0.0f, 1.0f));
ImGui::Begin("Scene", NULL);
ImGui::End();
ImGui::Begin("Properties", NULL);
ImGui::End();
ImGui::PopStyleColor(2);
i have same issue