mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-20 23:06:36 +00:00
Merge branch 'master' into docking
# Conflicts: # imgui.cpp # imgui_internal.h
This commit is contained in:
commit
8596f2b0fc
14
imgui.cpp
14
imgui.cpp
@ -4419,7 +4419,7 @@ static void ImGui::EndFrameDrawDimmedBackgrounds()
|
|||||||
ImGuiViewportP* viewport = g.Viewports[viewport_n];
|
ImGuiViewportP* viewport = g.Viewports[viewport_n];
|
||||||
if (modal_window && viewport == modal_window->Viewport)
|
if (modal_window && viewport == modal_window->Viewport)
|
||||||
continue;
|
continue;
|
||||||
if (g.NavWindowingList && viewport == g.NavWindowingList->Viewport)
|
if (g.NavWindowingListWindow && viewport == g.NavWindowingListWindow->Viewport)
|
||||||
continue;
|
continue;
|
||||||
if (g.NavWindowingTargetAnim && viewport == g.NavWindowingTargetAnim->Viewport)
|
if (g.NavWindowingTargetAnim && viewport == g.NavWindowingTargetAnim->Viewport)
|
||||||
continue;
|
continue;
|
||||||
@ -4567,7 +4567,7 @@ void ImGui::Render()
|
|||||||
// Add ImDrawList to render
|
// Add ImDrawList to render
|
||||||
ImGuiWindow* windows_to_render_top_most[2];
|
ImGuiWindow* windows_to_render_top_most[2];
|
||||||
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
|
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
|
||||||
windows_to_render_top_most[1] = (g.NavWindowingTarget ? g.NavWindowingList : NULL);
|
windows_to_render_top_most[1] = (g.NavWindowingTarget ? g.NavWindowingListWindow : NULL);
|
||||||
for (int n = 0; n != g.Windows.Size; n++)
|
for (int n = 0; n != g.Windows.Size; n++)
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = g.Windows[n];
|
ImGuiWindow* window = g.Windows[n];
|
||||||
@ -6030,7 +6030,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
bool window_title_visible_elsewhere = false;
|
bool window_title_visible_elsewhere = false;
|
||||||
if ((window->Viewport && window->Viewport->Window == window) || (window->DockIsActive))
|
if ((window->Viewport && window->Viewport->Window == window) || (window->DockIsActive))
|
||||||
window_title_visible_elsewhere = true;
|
window_title_visible_elsewhere = true;
|
||||||
else if (g.NavWindowingList != NULL && (window->Flags & ImGuiWindowFlags_NoNavFocus) == 0) // Window titles visible when using CTRL+TAB
|
else if (g.NavWindowingListWindow != NULL && (window->Flags & ImGuiWindowFlags_NoNavFocus) == 0) // Window titles visible when using CTRL+TAB
|
||||||
window_title_visible_elsewhere = true;
|
window_title_visible_elsewhere = true;
|
||||||
if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->Name) != 0)
|
if (window_title_visible_elsewhere && !window_just_created && strcmp(name, window->Name) != 0)
|
||||||
{
|
{
|
||||||
@ -6427,8 +6427,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
PushClipRect(host_rect.Min, host_rect.Max, false);
|
PushClipRect(host_rect.Min, host_rect.Max, false);
|
||||||
|
|
||||||
// Draw modal or window list full viewport dimming background (for other viewports we'll render them in EndFrame)
|
// Draw modal or window list full viewport dimming background (for other viewports we'll render them in EndFrame)
|
||||||
|
ImGuiWindow* window_window_list = g.NavWindowingListWindow;
|
||||||
const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetTopMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0;
|
const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetTopMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0;
|
||||||
const bool dim_bg_for_window_list = g.NavWindowingTargetAnim && ((window == g.NavWindowingTargetAnim->RootWindow) || (g.NavWindowingList && (window == g.NavWindowingList) && g.NavWindowingList->Viewport != g.NavWindowingTargetAnim->Viewport));
|
const bool dim_bg_for_window_list = g.NavWindowingTargetAnim && ((window == g.NavWindowingTargetAnim->RootWindow) || (window == window_window_list && window_window_list->Viewport != g.NavWindowingTargetAnim->Viewport));
|
||||||
if (dim_bg_for_modal || dim_bg_for_window_list)
|
if (dim_bg_for_modal || dim_bg_for_window_list)
|
||||||
{
|
{
|
||||||
const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio);
|
const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio);
|
||||||
@ -7323,6 +7324,7 @@ void ImGui::ActivateItem(ImGuiID id)
|
|||||||
g.NavNextActivateId = id;
|
g.NavNextActivateId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: this is storing in same stack as IDStack, so Push/Pop mismatch will be reported there.
|
||||||
void ImGui::PushFocusScope(ImGuiID id)
|
void ImGui::PushFocusScope(ImGuiID id)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
@ -9841,8 +9843,8 @@ void ImGui::NavUpdateWindowingOverlay()
|
|||||||
if (g.NavWindowingTimer < NAV_WINDOWING_LIST_APPEAR_DELAY)
|
if (g.NavWindowingTimer < NAV_WINDOWING_LIST_APPEAR_DELAY)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g.NavWindowingList == NULL)
|
if (g.NavWindowingListWindow == NULL)
|
||||||
g.NavWindowingList = FindWindowByName("###NavWindowingList");
|
g.NavWindowingListWindow = FindWindowByName("###NavWindowingList");
|
||||||
ImGuiViewportP* viewport = /*g.NavWindow ? g.NavWindow->Viewport :*/ (ImGuiViewportP*)GetMainViewport();
|
ImGuiViewportP* viewport = /*g.NavWindow ? g.NavWindow->Viewport :*/ (ImGuiViewportP*)GetMainViewport();
|
||||||
SetNextWindowSizeConstraints(ImVec2(viewport->Size.x * 0.20f, viewport->Size.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX));
|
SetNextWindowSizeConstraints(ImVec2(viewport->Size.x * 0.20f, viewport->Size.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX));
|
||||||
SetNextWindowPos(viewport->Pos + viewport->Size * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
SetNextWindowPos(viewport->Pos + viewport->Size * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||||
|
741
imgui_internal.h
741
imgui_internal.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user