mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Nav: Not exposing ImGuiWindowFlags_NavFlattened because it requires much more work (#323)
This commit is contained in:
parent
08a28c16ae
commit
a154625a56
12
imgui.cpp
12
imgui.cpp
@ -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
|
||||
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);
|
||||
NavInitWindow(child_window, false);
|
||||
@ -4220,7 +4220,7 @@ void ImGui::EndChild()
|
||||
ImGuiID id = parent_window->GetChildID(window);
|
||||
ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + 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);
|
||||
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)
|
||||
flags |= ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize;
|
||||
|
||||
if (flags & ImGuiWindowFlags_NavFlattened)
|
||||
IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow);
|
||||
//if (flags & ImGuiWindowFlags_NavFlattened)
|
||||
// IM_ASSERT(flags & ImGuiWindowFlags_ChildWindow);
|
||||
|
||||
// Find or create
|
||||
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->RootNonPopupWindow = g.CurrentWindowStack[root_non_popup_idx]; // Used to display TitleBgActive color and for selecting which window to use for NavWindowing
|
||||
window->RootNavWindow = window;
|
||||
while (window->RootNavWindow->Flags & ImGuiWindowFlags_NavFlattened)
|
||||
window->RootNavWindow = window->RootNavWindow->ParentWindow;
|
||||
//while (window->RootNavWindow->Flags & ImGuiWindowFlags_NavFlattened)
|
||||
// window->RootNavWindow = window->RootNavWindow->ParentWindow;
|
||||
|
||||
// When reusing window again multiple times a frame, just append content (don't need to setup again)
|
||||
if (first_begin_of_the_frame)
|
||||
|
2
imgui.h
2
imgui.h
@ -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_NoNavFocus = 1 << 17, // No focusing of this window with gamepad/keyboard navigation
|
||||
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]
|
||||
ImGuiWindowFlags_ChildWindow = 1 << 22, // Don't use! For internal use by BeginChild()
|
||||
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::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
|
||||
ImGui::EndChild();
|
||||
ImGui::BeginChild("buttons", ImVec2(0,0), false, ImGuiWindowFlags_NavFlattened);
|
||||
ImGui::BeginChild("buttons");
|
||||
if (ImGui::Button("Revert")) {}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Save")) {}
|
||||
|
Loading…
Reference in New Issue
Block a user