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 some widget on titlebar #5449

Closed
OmhaRobin opened this issue Jul 3, 2022 · 3 comments
Closed

Add some widget on titlebar #5449

OmhaRobin opened this issue Jul 3, 2022 · 3 comments

Comments

@OmhaRobin
Copy link

Version/Branch of Dear ImGui:

Version: 1.87
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Operating System: win10

My Issue/Question:

How can I add a input widget by ImGui::InputText() on the right of titlebar as the figure shown? I have let the window has the same size as the GLFW window and used ImGui::Begin("##my window", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize); to change the titlebar settings. Please ignore the texture image on the left.

Screenshots/Video

image

@OmhaRobin
Copy link
Author

ImGui::RenderWindowTitleBarContents(): Should I change this function to put a texture image or input widget on titlebar?

@ocornut
Copy link
Owner

ocornut commented Jul 5, 2022

I guess you would generally need to push a clip rect, see what BeginMenuBar() is doing, you'd want to do something similar.

Also see #5115 (which I left answered in spite of being well crafted, apologies to Simon). And #4385. #4137, #3882.

@OmhaRobin
Copy link
Author

@ocornut Thank you, I'll try what you said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants