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

Question: Styling window title when docked inside another window? #5322

Open
Jaysmito101 opened this issue May 18, 2022 · 3 comments
Open

Question: Styling window title when docked inside another window? #5322

Jaysmito101 opened this issue May 18, 2022 · 3 comments

Comments

@Jaysmito101
Copy link

Dear ImGui 1.88 WIP (18716)
--------------------------------

sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _WIN64
define: _MSC_VER=1930
define: _MSVC_LANG=201402
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------

io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000041
 NavEnableKeyboard
 DockingEnable
io.ConfigViewportsNoAutoMerge
io.ConfigViewportsNoDecoration
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------

io.Fonts: 5 fonts, Flags: 0x00000000, TexSize: 512,512
io.DisplaySize: 1366.00,705.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------

style.WindowPadding: 15.00,15.00
style.WindowBorderSize: 1.00
style.FramePadding: 5.00,5.00
style.FrameRounding: 3.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 12.00,8.00
style.ItemInnerSpacing: 8.00,6.00

My Issue/Question:

I was trying to style the title bar of the window with Push/Pop StyleVar calls.
I tried placing the calls before and after ImGui::Begin and that works perfectly when the window is not docked but when its docked the style is not applied. I guessed this is because the title is drawn by the dockspace when its docked so i added the style Push/Pop calls before the main dockspace and it works when the windows are docked in the main dockspace but when its docked inside another window it doesn't work. So, is there a way to modify the style of window title when docked?

@ocornut
Copy link
Owner

ocornut commented May 18, 2022

Hello,

You are not specifying which StyleVar you are trying to alter. The effect of varying tabs using varying style vars when docked is tricky to settle for and specific to each style var. The values of style variable between NewFrame() will alter some of those for docking tab bars.

See #2700, #2539, #3537, #3521, #4953.

@Jaysmito101
Copy link
Author

Jaysmito101 commented May 18, 2022

@ocornut Sorry for not mentioning.

I am trying to increase FramePadding of the title when the window is docked.
To be exact I i want to have the same style of the title as in the docking preview in the docked window.
Here is a screen shot:
I want the title to look like:
Screenshot (545)
And not like:
Screenshot (546)

With what I get I will need to increase FramePadding.
(For the font I think I will change the default font to the required one as suggested in #4953 (comment))

@ocornut
Copy link
Owner

ocornut commented May 18, 2022

As with #4953 and others you can set the FramePadding value before calling NewFrame().

I am not sure how you expect this to be handled automatically with heterogeneous values. Perhaps the docking tab bar could use the MAX of all FramePadding ?

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