Nav: Not exposing ImGuiWindowFlags_NavFlattened because it requires much more work (#323)

docking
ocornut 8 years ago
parent 08a28c16ae
commit a154625a56

@ -4179,7 +4179,7 @@ bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border,
// Process navigation-in immediately so NavInit can run on first frame // Process navigation-in immediately so NavInit can run on first frame
const ImGuiID id = parent_window->GetChildID(child_window); const ImGuiID id = parent_window->GetChildID(child_window);
if (!(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveFlags != 0 || child_window->DC.NavHasScroll) && GImGui->NavActivateId == id) if (/*!(flags & ImGuiWindowFlags_NavFlattened) &&*/ (child_window->DC.NavLayerActiveFlags != 0 || child_window->DC.NavHasScroll) && GImGui->NavActivateId == id)
{ {
FocusWindow(child_window); FocusWindow(child_window);
NavInitWindow(child_window, false); NavInitWindow(child_window, false);
@ -4220,7 +4220,7 @@ void ImGui::EndChild()
ImGuiID id = parent_window->GetChildID(window); ImGuiID id = parent_window->GetChildID(window);
ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz); ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz);
ItemSize(sz); ItemSize(sz);
if (!(window->Flags & ImGuiWindowFlags_NavFlattened) && (window->DC.NavLayerActiveFlags != 0 || window->DC.NavHasScroll)) if (/*!(window->Flags & ImGuiWindowFlags_NavFlattened) &&*/ (window->DC.NavLayerActiveFlags != 0 || window->DC.NavHasScroll))
{ {
ItemAdd(bb, &id); ItemAdd(bb, &id);
RenderNavHighlight(id, bb); RenderNavHighlight(id, bb);
@ -4420,8 +4420,8 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
if (flags & ImGuiWindowFlags_NoInputs) if (flags & ImGuiWindowFlags_NoInputs)
flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize; flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
if (flags & ImGuiWindowFlags_NavFlattened) //if (flags & ImGuiWindowFlags_NavFlattened)
IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow); // IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow);
// Find or create // Find or create
bool window_is_new = false; bool window_is_new = false;
@ -4520,8 +4520,8 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
window->RootWindow = g.CurrentWindowStack[root_idx]; window->RootWindow = g.CurrentWindowStack[root_idx];
window->RootNonPopupWindow = g.CurrentWindowStack[root_non_popup_idx]; // Used to display TitleBgActive color and for selecting which window to use for NavWindowing window->RootNonPopupWindow = g.CurrentWindowStack[root_non_popup_idx]; // Used to display TitleBgActive color and for selecting which window to use for NavWindowing
window->RootNavWindow = window; window->RootNavWindow = window;
while (window->RootNavWindow->Flags & ImGuiWindowFlags_NavFlattened) //while (window->RootNavWindow->Flags & ImGuiWindowFlags_NavFlattened)
window->RootNavWindow = window->RootNavWindow->ParentWindow; // window->RootNavWindow = window->RootNavWindow->ParentWindow;
// When reusing window again multiple times a frame, just append content (don't need to setup again) // When reusing window again multiple times a frame, just append content (don't need to setup again)
if (first_begin_of_the_frame) if (first_begin_of_the_frame)

@ -511,7 +511,7 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient) ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
ImGuiWindowFlags_NoNavFocus = 1 << 17, // No focusing of this window with gamepad/keyboard navigation ImGuiWindowFlags_NoNavFocus = 1 << 17, // No focusing of this window with gamepad/keyboard navigation
ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window
ImGuiWindowFlags_NavFlattened = 1 << 19, // Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!) //ImGuiWindowFlags_NavFlattened = 1 << 19, // Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
// [Internal] // [Internal]
ImGuiWindowFlags_ChildWindow = 1 << 22, // Don't use! For internal use by BeginChild() ImGuiWindowFlags_ChildWindow = 1 << 22, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ComboBox = 1 << 23, // Don't use! For internal use by ComboBox() ImGuiWindowFlags_ComboBox = 1 << 23, // Don't use! For internal use by ComboBox()

@ -2443,7 +2443,7 @@ static void ShowExampleAppLayout(bool* p_open)
ImGui::Separator(); ImGui::Separator();
ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "); ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
ImGui::EndChild(); ImGui::EndChild();
ImGui::BeginChild("buttons", ImVec2(0,0), false, ImGuiWindowFlags_NavFlattened); ImGui::BeginChild("buttons");
if (ImGui::Button("Revert")) {} if (ImGui::Button("Revert")) {}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Save")) {} if (ImGui::Button("Save")) {}

Loading…
Cancel
Save