GithubHelp home page GithubHelp logo

Comments (3)

XMNXofficial avatar XMNXofficial commented on June 1, 2024

I have a idea:

in docking_details.cpp

void ImplProvideFullScreenDockSpace(const ImGuiWindowParams& imGuiWindowParams)
{
    DoCreateFullScreenImGuiWindow(imGuiWindowParams, true);
    ImGuiID mainDockspaceId = ImGui::GetID("MainDockSpace");
    ImGuiDockNodeFlags dockspace_flags =
        ImGuiDockNodeFlags_PassthruCentralNode;  // ImGuiDockNodeFlags_PassthruDockspace;

    if(imGuiWindowParams.Enable_MainDockSpace_KeepAliveOnly)
        dockspace_flags |= ImGuiDockNodeFlags_KeepAliveOnly;
    if(imGuiWindowParams.Enable_MainDockSpace_NoResize)
        dockspace_flags |= ImGuiDockNodeFlags_NoResize;
    if(imGuiWindowParams.Enable_MainDockSpace_NoTabBar)
        dockspace_flags |= ImGuiDockNodeFlags_NoTabBar;
    
    ImGui::DockSpace(mainDockspaceId, ImVec2(0.0f, 0.0f), dockspace_flags);
    gImGuiSplitIDs["MainDockSpace"] = mainDockspaceId;
}

in imgui_window_params.h

struct ImGuiWindowParams
{
    DefaultImGuiWindowType defaultImGuiWindowType = DefaultImGuiWindowType::ProvideFullScreenWindow;

    ImVec4 backgroundColor = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);

    bool showMenuBar = false;
    bool showMenu_App = true;
    bool showMenu_App_Quit = true;
    bool showMenu_View = true;

    bool showStatusBar = false;
    bool showStatus_Fps = true;
    bool rememberStatusBarSettings = true;

    bool configWindowsMoveFromTitleBarOnly = true;

    bool enableViewports = false;

    std::string menuAppTitle = "";

    ImGuiTheme::ImGuiTweakedTheme tweakedTheme;
    bool showMenu_View_Themes = true;
    bool rememberTheme = true;

    bool Enable_MainDockSpace_KeepAliveOnly = false;
    bool Enable_MainDockSpace_NoResize = false;
    bool Enable_MainDockSpace_NoTabBar = false;
};

}  // namespace HelloImGui

from hello_imgui.

pthom avatar pthom commented on June 1, 2024

Hi, thanks for the proposition. I'm back from a long holiday, but I will check it soon.

from hello_imgui.

pthom avatar pthom commented on June 1, 2024

Hi,

I implemented something close to your suggestion, however it happens inside DockingParams and it uses the original ImGui flags.

In docking_params.h, we now have:

struct DockingParams
{
    std::vector<DockingSplit>   dockingSplits;
    std::vector<DockableWindow> dockableWindows;

    std::string layoutName = "Default";

    DockingLayoutCondition layoutCondition = DockingLayoutCondition::FirstUseEver;
    bool layoutReset = false;

    // **********************
    //      This was added 
    // **********************
    ImGuiDockNodeFlags mainDockSpaceNodeFlags = ImGuiDockNodeFlags_PassthruCentralNode;

    // Helpers
    DockableWindow * dockableWindowOfName(const std::string& name);
    void focusDockableWindow(const std::string& windowName);
    std::optional<ImGuiID> dockSpaceIdFromName(const std::string& dockSpaceName);
};

And the demo hello_imgui_demodocking will demonstrate the usage interactively:

image

from hello_imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.