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

How can we change the title background color of a docked window? #8413

Open
mikeemm opened this issue Feb 19, 2025 · 0 comments
Open

How can we change the title background color of a docked window? #8413

mikeemm opened this issue Feb 19, 2025 · 0 comments

Comments

@mikeemm
Copy link

mikeemm commented Feb 19, 2025

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:

title_docked_vs_undocked.mp4

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants