ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
60.62k stars 10.23k forks source link

Standalone viewports windows: minimize and maximize buttons #3486

Open GdLinkLock opened 4 years ago

GdLinkLock commented 4 years ago

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

My Way

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);
  2. 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

ocornut commented 4 years ago

This is not supported indeed.

OverShifted commented 4 years ago

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

GdLinkLock commented 4 years ago

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