ocornut / imgui

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

Vertical Docked Tabs #3722

Open aiekick opened 3 years ago

aiekick commented 3 years ago

Version/Branch of Dear ImGui:

Version: Current Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp Compiler: MSVC Operating System: Win 10 X64

My Issue/Question:

Its not an issue.

i would like to add a feature to the docking branch. who is vertical tabs like on the screenshot below of blender with font icon on my side but can be also for text

blender_r7tVzCtUDq

i can do that static easily but my goal is to have the ability to dock a window and define the way the window will dock. by ex define a flag who set the docktab preference like Vertical_Left/Right and Horizontal_Left/Right. like that we could have some tabs vertically or horizontally on any side at same time :)

i would like at some stage to propose a pull request, this si why i would ask what is the behavior you imagine is the best. i want respect the philosophy of imgui :)

so the goal could be : 1) define the way a window will dock H/V and L/R side (maybe a flag on the window begin or another behavior) 2) define the orientation of text in tabs, H/V L/R (where to put this flag if its is a flag) 3) maybe transform the tab in a container who can contain whatever the user want. can be a text, with a button, or other things.

the point 2 can be annoying maybe the 3 is more souple for make the 2 and more. the 3 can serve to do a ribbon like or something too haha :)

i understand it can be complex but i would like to try.

thanks.

aiekick commented 3 years ago

to delete i think

ocornut commented 3 years ago

Helllo, Why deleting/closing? Did you change your mind?

aiekick commented 3 years ago

Hello,

no i not changed my mind, i always would like to do it. but i found another post on the similar things, and you mentionned in this post, than its planned but until the end of WorkRect reworking or something like that. and you mentionned also the vertical text feature.

in my mind vertical text is not very readable btw.

so maybe this post, is not necesary maybe redundant. dont know. i know you are very busy too

if you are interested by this post we can keep it opened. no problem

to note, when i spoke about transfrom tab in a container, i spoke about tab label.

maybe with a similar way as we define a ImGuiWindowFlags_MenuBar

Something like that :

if (ImGui::BeginTabBar("MyTabBar"))
{
   if (ImGui::BeginTabItem("Avocado", ImGuiTabBarFlags_Container))
    {
        if (ImGui::BeginTabItemContainer())
        {
            ImGui::Text("label");
            ImGui::Button("settings");

            ImGui::EndTabItemContainer();
        }

        ImGui::Text("This is the Avocado tab!\nblah blah blah blah blah");

        ImGui::EndTabItem();
    }
    if (ImGui::BeginTabItem("Broccoli"))
    {
        ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah");
        ImGui::EndTabItem();
    }
    if (ImGui::BeginTabItem("Cucumber"))
    {
        ImGui::Text("This is the Cucumber tab!\nblah blah blah blah blah");
        ImGui::EndTabItem();
    }
    ImGui::EndTabBar();
}

edit : the container what not in the good place. he must be inside a tab item :)

aiekick commented 3 years ago

what do you think of it ?

ocornut commented 3 years ago

I don't understand this container thing you mention.

aiekick commented 3 years ago

what i call the container is the zone who actually contain the label. but could contain other things like a button or whatever the user want. can be interesting when tabs are verticals.

see this picture (im not an artist haha)

the first container contain a text (label) and a button (green circle) inkscape_InovUUphUW

my question was also about the vertical dock. i think it could be interesting to define the expected way (how a window will dock in tabs) in the window flag. but nor sure if its the best way (in possibility for the user and/or the futur)