mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-17 01:04:19 +00:00
Merge branch 'master' into docking
This commit is contained in:
commit
fd75685fb0
7 changed files with 388 additions and 34 deletions
37
imgui.cpp
37
imgui.cpp
|
|
@ -7,15 +7,19 @@
|
|||
// - Read top of imgui.cpp for more details, links and comments.
|
||||
|
||||
// Resources:
|
||||
// - FAQ https://dearimgui.com/faq
|
||||
// - Getting Started https://dearimgui.com/getting-started
|
||||
// - Homepage https://github.com/ocornut/imgui
|
||||
// - Releases & changelog https://github.com/ocornut/imgui/releases
|
||||
// - Gallery https://github.com/ocornut/imgui/issues/6897 (please post your screenshots/video there!)
|
||||
// - Wiki https://github.com/ocornut/imgui/wiki (lots of good stuff there)
|
||||
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
|
||||
// - Issues & support https://github.com/ocornut/imgui/issues
|
||||
// - Tests & Automation https://github.com/ocornut/imgui_test_engine
|
||||
// - FAQ ........................ https://dearimgui.com/faq (in repository as docs/FAQ.md)
|
||||
// - Homepage ................... https://github.com/ocornut/imgui
|
||||
// - Releases & changelog ....... https://github.com/ocornut/imgui/releases
|
||||
// - Gallery .................... https://github.com/ocornut/imgui/issues/6897 (please post your screenshots/video there!)
|
||||
// - Wiki ....................... https://github.com/ocornut/imgui/wiki (lots of good stuff there)
|
||||
// - Getting Started https://github.com/ocornut/imgui/wiki/Getting-Started (how to integrate in an existing app by adding ~25 lines of code)
|
||||
// - Third-party Extensions https://github.com/ocornut/imgui/wiki/Useful-Extensions (ImPlot & many more)
|
||||
// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings, backends for various tech/engines)
|
||||
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
|
||||
// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools
|
||||
// - Software using Dear ImGui https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui
|
||||
// - Issues & support ........... https://github.com/ocornut/imgui/issues
|
||||
// - Test Engine & Automation ... https://github.com/ocornut/imgui_test_engine (test suite, test engine to automate your apps)
|
||||
|
||||
// For first-time users having issues compiling/linking/running/loading fonts:
|
||||
// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
|
||||
|
|
@ -7042,8 +7046,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||
window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWindowData.MenuBarOffsetMinVal.x);
|
||||
window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y;
|
||||
|
||||
// Depending on condition we use previous or current window size to compare against contents size to decide if a scrollbar should be visible.
|
||||
// Those flags will be altered further down in the function depending on more conditions.
|
||||
bool use_current_size_for_scrollbar_x = window_just_created;
|
||||
bool use_current_size_for_scrollbar_y = window_just_created;
|
||||
if (window_size_x_set_by_api && window->ContentSizeExplicit.x != 0.0f)
|
||||
use_current_size_for_scrollbar_x = true;
|
||||
if (window_size_y_set_by_api && window->ContentSizeExplicit.y != 0.0f) // #7252
|
||||
use_current_size_for_scrollbar_y = true;
|
||||
|
||||
// Collapse window by double-clicking on title bar
|
||||
// At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing
|
||||
|
|
@ -7051,8 +7061,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||
{
|
||||
// We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), so verify that we don't have items over the title bar.
|
||||
ImRect title_bar_rect = window->TitleBarRect();
|
||||
if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseClickedCount[0] == 2)
|
||||
window->WantCollapseToggle = true;
|
||||
if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max))
|
||||
if (g.IO.MouseClickedCount[0] == 2 && GetKeyOwner(ImGuiKey_MouseLeft) == ImGuiKeyOwner_None)
|
||||
window->WantCollapseToggle = true;
|
||||
if (window->WantCollapseToggle)
|
||||
{
|
||||
window->Collapsed = !window->Collapsed;
|
||||
|
|
@ -11562,8 +11573,8 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_
|
|||
if (restore_focus_to_window_under_popup && prev_popup.Window)
|
||||
{
|
||||
ImGuiWindow* popup_window = prev_popup.Window;
|
||||
ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow;
|
||||
if (focus_window && !focus_window->WasActive && popup_window)
|
||||
ImGuiWindow* focus_window = (popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow;
|
||||
if (focus_window && !focus_window->WasActive)
|
||||
FocusTopMostWindowUnderOne(popup_window, NULL, NULL, ImGuiFocusRequestFlags_RestoreFocusedChild); // Fallback
|
||||
else
|
||||
FocusWindow(focus_window, (g.NavLayer == ImGuiNavLayer_Main) ? ImGuiFocusRequestFlags_RestoreFocusedChild : ImGuiFocusRequestFlags_None);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue