imgui icon indicating copy to clipboard operation
imgui copied to clipboard

Standalone viewports windows: minimize and maximize buttons

Open GdLinkLock opened this issue 5 years ago • 3 comments

Version/Branch of Dear ImGui:

Version: 1.78 Branch: master , enable docking and viewport

    // Setup back-end capabilities flags
    ImGuiIO& io = ImGui::GetIO();
    io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;         // We can honor GetMouseCursor() values (optional)
    io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos;          // We can honor io.WantSetMousePos requests (optional, rarely used)
    io.BackendFlags |= ImGuiBackendFlags_PlatformHasViewports;    // We can create multi-viewports on the Platform side (optional)
    io.BackendFlags |= ImGuiBackendFlags_HasMouseHoveredViewport; // We can set io.MouseHoveredViewport correctly (optional, not easy)
    io.BackendPlatformName = "imgui_impl_win32";

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_dx9.cpp + imgui_impl_win32.cpp Compiler: vs2017 Operating System: win10

My target I want to wirte an editor like UE Editor:like this: https://youtu.be/jizOSy2e9d0

  • UE4 Editor has an world editor
  • Material Editor as an subeditor,has a separate editing window
  • all the separate editing windows can tab to each other

My Way

  • main editor has an fullscreen dockspace
  • sub-editor has another dockspace

My Issue

  1. sub-eiditor does not have minimize and maximize buttons

Options

  1. use SetNextWindowClass;but there are some refresh issues when risizing https://youtu.be/mWDCLju2lkw
ImGuiWindowClass WindowClass;
WindowClass.ViewportFlagsOverrideClear = ImGuiViewportFlags_NoDecoration | ImGuiViewportFlags_NoTaskBarIcon;
ImGui::SetNextWindowClass(&WindowClass);
  1. ues drawlist to draw an minsizebox and an maxsizebox, like the code in closebutton

My Question: IMGUI Window only have close button,no minimize and maximize buttons; What is the the best advice to maximize and minimize

IMGUI Window Style: image

Default Window Style: image

GdLinkLock avatar Sep 22 '20 11:09 GdLinkLock

This is not supported indeed.

ocornut avatar Sep 22 '20 12:09 ocornut

What do you mean by minimizing? ImGui is not a window management program. there is no dock/taskbar to minimize your window. maximizing makes more sense because you can fit that to the main viewport(while you are not using viewports or docking branch, that means the host window). if you really want this functionality (which I never found helpful) you can implement that by your own

OverShifted avatar Sep 22 '20 14:09 OverShifted

What do you mean by minimizing? ImGui is not a window management program. there is no dock/taskbar to minimize your window. maximizing makes more sense because you can fit that to the main viewport(while you are not using viewports or docking branch, that means the host window). if you really want this functionality (which I never found helpful) you can implement that by your own

thanks for replying;I have added more information

GdLinkLock avatar Sep 23 '20 06:09 GdLinkLock