mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-04 04:00:07 +00:00
Merge branch 'master' into docking
# Conflicts: # imgui.cpp # imgui_demo.cpp
This commit is contained in:
commit
4a3a895be9
10 changed files with 98 additions and 50 deletions
22
imgui.cpp
22
imgui.cpp
|
|
@ -4515,6 +4515,18 @@ bool ImGui::IsItemActive()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ImGui::IsItemActivated()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.ActiveId)
|
||||
{
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
if (g.ActiveId == window->DC.LastItemId && g.ActiveIdPreviousFrame != window->DC.LastItemId)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ImGui::IsItemDeactivated()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
|
@ -6805,7 +6817,7 @@ void ImGui::SetNextWindowClass(const ImGuiWindowClass* window_class)
|
|||
g.NextWindowData.WindowClass = *window_class;
|
||||
}
|
||||
|
||||
// In window space (not screen space!)
|
||||
// FIXME: This is in window space (not screen space!)
|
||||
ImVec2 ImGui::GetContentRegionMax()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindowRead();
|
||||
|
|
@ -7176,7 +7188,7 @@ void ImGui::EndGroup()
|
|||
if (group_data.AdvanceCursor)
|
||||
{
|
||||
window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrentLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
|
||||
ItemSize(group_bb.GetSize(), group_data.BackupCurrentLineTextBaseOffset);
|
||||
ItemSize(group_bb.GetSize(), 0.0f);
|
||||
ItemAdd(group_bb, 0);
|
||||
}
|
||||
|
||||
|
|
@ -7683,10 +7695,10 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
|
|||
ImGuiContext& g = *GImGui;
|
||||
if (window->Flags & ImGuiWindowFlags_ChildMenu)
|
||||
{
|
||||
// Child menus typically request _any_ position within the parent menu item, and then our FindBestWindowPosForPopup() function will move the new menu outside the parent bounds.
|
||||
// Child menus typically request _any_ position within the parent menu item, and then we move the new menu outside the parent bounds.
|
||||
// This is how we end up with child menus appearing (most-commonly) on the right of the parent menu.
|
||||
ImGuiWindow* parent_window = window->ParentWindow;
|
||||
float horizontal_overlap = g.Style.ItemSpacing.x; // We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x).
|
||||
float horizontal_overlap = g.Style.ItemInnerSpacing.x; // We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x).
|
||||
ImRect r_outer = GetWindowAllowedExtentRect(window);
|
||||
ImRect r_avoid;
|
||||
if (parent_window->DC.MenuBarAppending)
|
||||
|
|
@ -13276,7 +13288,7 @@ void ImGui::LogToFile(int max_depth, const char* filename)
|
|||
g.LogFile = ImFileOpen(filename, "ab");
|
||||
if (g.LogFile == NULL)
|
||||
{
|
||||
IM_ASSERT(g.LogFile != NULL); // Consider this an error
|
||||
IM_ASSERT(0);
|
||||
return;
|
||||
}
|
||||
g.LogEnabled = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue