Merge branch 'master' into docking

This commit is contained in:
ocornut
2025-11-20 18:01:02 +01:00
13 changed files with 282 additions and 86 deletions

View File

@@ -2,7 +2,9 @@
1. PLEASE CAREFULLY READ: [Contributing Guidelines](https://github.com/ocornut/imgui/blob/master/docs/CONTRIBUTING.md)
2. Make sure you're using a special branch just for this pull request. (Sometimes people unknowingly use a default branch, then later update that branch, which updates the pull request with the other changes if it hasn't been merged yet.)
2. **Make sure you're using a special branch just for this pull request**. (In git, 1 PR = 1 branch. If you update the branch the PR will be updated.)
3. Clear this template before submitting your PR.
3. Consider running the [imgui_test_suite](https://github.com/ocornut/imgui_test_engine) or adding new tests to test for expected behaviors.
4. Clear this template before submitting your PR.

View File

@@ -16,13 +16,21 @@ on:
- requested
jobs:
Windows:
Build-Windows:
runs-on: windows-2025
name: Build - Windows
defaults:
run:
working-directory: ${{ github.workspace }}/imgui
env:
VS_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
path: ${{ github.workspace }}/imgui
# The VulkanSDK libs for Windows is manually generated using build_windows_vulkan_libs.ps1 + attached to issue #8925.
# (we have a .yml workflow in commit history if it becomes ever useful to create this on CI too)
@@ -257,10 +265,18 @@ jobs:
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'
Linux:
Build-Linux:
runs-on: ubuntu-latest
name: Build - Linux
defaults:
run:
working-directory: ${{ github.workspace }}/imgui
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
path: ${{ github.workspace }}/imgui
- name: Install Dependencies
run: |
@@ -474,10 +490,18 @@ jobs:
- name: Build with IMGUI_IMPL_VULKAN_NO_PROTOTYPES
run: g++ -c -I. -std=c++11 -DIMGUI_IMPL_VULKAN_NO_PROTOTYPES=1 backends/imgui_impl_vulkan.cpp
MacOS:
Build-MacOS:
runs-on: macos-latest
name: Build - MacOS
defaults:
run:
working-directory: ${{ github.workspace }}/imgui
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
path: ${{ github.workspace }}/imgui
- name: Install Dependencies
run: |
@@ -548,20 +572,24 @@ jobs:
- name: Build example_apple_opengl2
run: xcodebuild -project examples/example_apple_opengl2/example_apple_opengl2.xcodeproj -target example_osx_opengl2
iOS:
Build-iOS:
runs-on: macos-14
name: Build - iOS
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Build example_apple_metal
run: |
# Code signing is required, but we disable it because it is irrelevant for CI builds.
xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
Emscripten:
Build-Emscripten:
runs-on: ubuntu-latest
name: Build - Emscripten
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install Dependencies
run: |
@@ -599,12 +627,148 @@ jobs:
emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release examples/example_glfw_wgpu
cmake --build build
Android:
Build-Android:
runs-on: ubuntu-latest
name: Build - Android
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Build example_android_opengl3
run: |
cd examples/example_android_opengl3/android
gradle assembleDebug --stacktrace
Test-Windows:
runs-on: windows-2025
name: Test - Windows
defaults:
run:
working-directory: ${{ github.workspace }}/imgui
env:
MSBUILD_PATH: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v5
with:
path: ${{ github.workspace }}/imgui
- uses: actions/checkout@v5
continue-on-error: true
with:
fetch-depth: 1
repository: ocornut/imgui_test_engine
path: ${{ github.workspace }}/imgui_test_engine
submodules: true
- name: Fix Tests Projects
shell: powershell
working-directory: ${{ github.workspace }}/imgui_test_engine
run: |
# WARNING: This will need updating if toolset/sdk change in project files!
gci -recurse -filter "*.vcxproj" | ForEach-Object {
# Fix SDK and toolset for most samples.
(Get-Content $_.FullName) -Replace "<PlatformToolset>v110</PlatformToolset>","<PlatformToolset>v142</PlatformToolset>" | Set-Content -Path $_.FullName
(Get-Content $_.FullName) -Replace "<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>","<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>" | Set-Content -Path $_.FullName
# Fix SDK and toolset for samples that require newer SDK/toolset. At the moment it is only dx12.
(Get-Content $_.FullName) -Replace "<PlatformToolset>v140</PlatformToolset>","<PlatformToolset>v142</PlatformToolset>" | Set-Content -Path $_.FullName
(Get-Content $_.FullName) -Replace "<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>","<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>" | Set-Content -Path $_.FullName
}
- name: Build Tests
shell: cmd
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: '"%MSBUILD_PATH%\MSBuild.exe" imgui_test_suite.vcxproj /p:Platform=x64 /p:Configuration=Release /p:ClFlags=/WX -maxcpucount:%NUMBER_OF_PROCESSORS%'
- name: Run Tests
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: Release/imgui_test_suite.exe -nogui -nopause -v2 -ve4 tests
- name: Check for Docking
id: check_docking
shell: bash
working-directory: ${{ github.workspace }}/imgui
run: echo "has_dock=$(grep -q "#define IMGUI_HAS_DOCK" imgui.h && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Run Viewport Tests
if: steps.check_docking.outputs.has_dock == 'true'
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: Release/imgui_test_suite.exe -nogui -nopause -v2 -ve4 -viewport-mock viewport
Test-Linux:
runs-on: ubuntu-latest
name: Test - Linux
defaults:
run:
working-directory: ${{ github.workspace }}/imgui
steps:
- uses: actions/checkout@v5
with:
path: ${{ github.workspace }}/imgui
- uses: actions/checkout@v5
with:
fetch-depth: 1
repository: ocornut/imgui_test_engine
path: ${{ github.workspace }}/imgui_test_engine
submodules: true
- name: Build Tests
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: make -j$(nproc)
- name: Run Tests
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 tests
- name: Check for Docking
id: check_docking
working-directory: ${{ github.workspace }}/imgui
run: echo "has_dock=$(grep -q "#define IMGUI_HAS_DOCK" imgui.h && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Run Viewport Tests
if: steps.check_docking.outputs.has_dock == 'true'
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 -viewport-mock viewport
Test-MacOS:
runs-on: macos-latest
name: Test - MacOS
defaults:
run:
working-directory: ${{ github.workspace }}/imgui
steps:
- uses: actions/checkout@v5
with:
path: ${{ github.workspace }}/imgui
- uses: actions/checkout@v5
with:
fetch-depth: 1
repository: ocornut/imgui_test_engine
path: ${{ github.workspace }}/imgui_test_engine
submodules: true
- name: Build Tests
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: make -j$(nproc)
- name: Run Tests
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 tests
- name: Check for Docking
id: check_docking
working-directory: ${{ github.workspace }}/imgui
run: echo "has_dock=$(grep -q "#define IMGUI_HAS_DOCK" imgui.h && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Run Viewport Tests
if: steps.check_docking.outputs.has_dock == 'true'
working-directory: ${{ github.workspace }}/imgui_test_engine/imgui_test_suite
run: ./imgui_test_suite -nogui -nopause -v2 -ve4 -viewport-mock viewport

View File

@@ -36,9 +36,11 @@ HOW TO UPDATE?
- Please report any issue!
-----------------------------------------------------------------------
VERSION 1.92.5 WIP (In Progress)
VERSION 1.92.5 (Released 2025-11-20)
-----------------------------------------------------------------------
Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.92.5
Breaking Changes:
- Keys: commented out legacy names which were obsoleted in 1.89.0 (August 2022).
@@ -61,13 +63,6 @@ Breaking Changes:
Other Changes:
- Tables: fixed a bug where nesting BeginTable()->Begin()->BeginTable() would
result in temporarily incorrect state, which would lead to bugs to side effects
in various locations, e.g. GetContentRegionAvail() calls or using clipper. (#9005)
EndTable() was mistakenly restoring a wrong current table.
- Tables: Angled headers: fixed an auto-resize feedback loop that could
affect tables with empty non-resizing columns using angled headers, making
them typically flicker back and forth between +0 and +1 pixels.
- Windows:
- Config flag io.ConfigWindowsMoveFromTitleBarOnly is now latched during
Begin(), effectively allowing to change the value on a per-window basis.
@@ -77,6 +72,14 @@ Other Changes:
scrollbar on the other axis. (#9060)
- Fixed an issue where repeated calls to SetNextWindowSize() using 0.0f
to auto-size on a given axis would keep marking ini settings as dirty.
- Tables:
- Fixed a bug where nesting BeginTable()->Begin()->BeginTable() would
result in temporarily incorrect state, which would lead to bugs to side effects
in various locations, e.g. GetContentRegionAvail() calls or using clipper. (#9005)
EndTable() was mistakenly restoring a wrong current table.
- Angled headers: fixed an auto-resize feedback loop that could
affect tables with empty non-resizing columns using angled headers, making
them typically flicker back and forth between +0 and +1 pixels.
- Disabled: fixed a bug when a previously enabled item that got nav focus
and then turns disabled could still be activated using keyboard. (#9036)
- InputText:
@@ -95,7 +98,7 @@ Other Changes:
most typically achieved when resizing programmatically or via a docking layout
reacting to a platform window resize). (#3237, #9007) [@anton-kl, @ocornut]
- Nav:
- Reworked PageUp/PageDown to pick same-page top/bottom page based
- Reworked PageUp/PageDown logic to pick same-page top/bottom page based
on inner rectangle rather than clipping rectangle, ensuring consistent
(but occasionally less practical) navigation result when a window is
partially out of screen. (#787)
@@ -116,9 +119,10 @@ Other Changes:
- Groups: fixed an issue reporting IsItemEdited() signal after EndGroup() when
triggered by some widgets e.g. Checkbox(), Selectable() and many others, which
cleared ActiveId at the same time as editing. (#9028)
Note that IsItemDeactivatedAfterEdit() was not affected, only IsItemEdited).
Note that IsItemDeactivatedAfterEdit() was not affected, only IsItemEdited().
- Misc: standardized casing of keyboard mods in comments and demo, showing
as e.g. "Ctrl" instead of "CTRL".
- CI: Added Dear ImGui Test Suite to CI builds. [@rokups]
- Drag and Drop:
- Added ImGuiDragDropFlags_AcceptDrawAsHovered to make accepting item render
as hovered, which can allow using e.g. Button() as drop target. (#8632)
@@ -136,7 +140,7 @@ Other Changes:
- Metrics: fixed table and columns rect highlight from display when
debug/metrics window is not in the same viewport as the table.
- Backends:
- Null: added imgui_impl_null platform/renderer backend.
- NULL: added imgui_impl_null platform/renderer backend.
This is designed if you need to run e.g. context with no input or no ouput.
- GLFW: fixed building on Linux platforms where Wayland headers
are not available. (#9024, #8969, #8921, #8920) [@jagot]
@@ -150,6 +154,10 @@ Other Changes:
field changes viewports. (#9054)
- Vulkan: added IMGUI_IMPL_VULKAN_VOLK_FILENAME to configure path to
Volk (default to "volk.h"). (#9008, #7722, #6582, #4854) [@mwlasiuk]
- WebGPU: update to compile with Dawn and Emscripten's 4.0.10+
'--use-port=emdawnwebgpu' ports. (#8381, #8898, #7435) [@brutpitt, @trbabb]
When using Emscripten 4.0.10+, backend now defaults to IMGUI_IMPL_WEBGPU_BACKEND_DAWN
instead of IMGUI_IMPL_WEBGPU_BACKEND_WGPU, if neither are specified.
- WebGPU: added various internal/optional helpers to wrap some of the
Dawn/WGPU/Emscripten debacle quirks: (#8381) [@brutpitt]
- ImGui_ImplWGPU_CreateWGPUSurfaceHelper().
@@ -158,15 +166,10 @@ Other Changes:
- ImGui_ImplWGPU_GetBackendTypeName(), ImGui_ImplWGPU_GetAdapterTypeName(),
ImGui_ImplWGPU_GetDeviceLostReasonName(), ImGui_ImplWGPU_GetErrorTypeName(),
ImGui_ImplWGPU_GetLogLevelName().
- WebGPU: update to compile with Dawn and Emscripten's 4.0.10+
'--use-port=emdawnwebgpu' ports. (#8381, #8898, #7435) [@brutpitt, @trbabb]
When using Emscripten 4.0.10+, backend now defaults to IMGUI_IMPL_WEBGPU_BACKEND_DAWN
instead of IMGUI_IMPL_WEBGPU_BACKEND_WGPU, if neither are specified.
(note: examples application were not updated yet)
- Win32: Revert 1.92.4 change of comparing dwPacketNumber, which prevents
refreshing accurate gamepad info after focus-out + io.ClearInputKeys(). (#8556)
- Examples:
- Null: update examples_null to use imgui_impl_null (which is a bit overengineering
- NULL: update examples_null to use imgui_impl_null (which is a bit overengineering
but somehow consistent).
- GLFW+WebGPU: update example for latest specs, to work on Emscripten 4.0.10+,
latest Dawn-Native and WGPU-Native. (#8381, #8567, #8191, #7435) [@brutpitt]
@@ -174,6 +177,7 @@ Other Changes:
during surface resize. (#8381)
- SDL2+WebGPU: added new example (Emscripten + native Dawn/WGPU). (#8381) [@brutpitt]
- SDL3+WebGPU: added new example (Emscripten + native Dawn/WGPU). (#8381) [@brutpitt]
- Win32+OpenGL3: enable DPI awareness. (#9083)
Docking+Viewports Branch:

View File

@@ -148,17 +148,23 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\backends\imgui_impl_null.h" />
<ClInclude Include="..\..\imconfig.h" />
<ClInclude Include="..\..\imgui.h" />
<ClInclude Include="..\..\imgui_internal.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\backends\imgui_impl_null.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\imgui.cpp" />
<ClCompile Include="..\..\imgui_demo.cpp" />
<ClCompile Include="..\..\imgui_draw.cpp" />
<ClCompile Include="..\..\imgui_tables.cpp" />
<ClCompile Include="..\..\imgui_widgets.cpp" />
<ClCompile Include="..\..\backends\imgui_impl_null.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>

View File

@@ -18,6 +18,9 @@
<ClInclude Include="..\..\imgui_internal.h">
<Filter>imgui</Filter>
</ClInclude>
<ClInclude Include="..\..\backends\imgui_impl_null.h">
<Filter>sources</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\imgui.cpp">

View File

@@ -73,7 +73,7 @@ static void Hook_Renderer_SwapBuffers(ImGuiViewport* viewport, void*)
int main(int, char**)
{
// Make process DPI aware and obtain main monitor scale
//ImGui_ImplWin32_EnableDpiAwareness(); // FIXME: This somehow doesn't work in the Win32+OpenGL example. Why?
ImGui_ImplWin32_EnableDpiAwareness();
float main_scale = ImGui_ImplWin32_GetDpiScaleForMonitor(::MonitorFromPoint(POINT{ 0, 0 }, MONITOR_DEFAULTTOPRIMARY));
// Create application window

View File

@@ -1,27 +1,28 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (main code and documentation)
// Help:
// - See links below.
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
// - Read top of imgui.cpp for more details, links and comments.
// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including imgui.h (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
// Resources:
// - 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
// - Releases & Changelog ....... https://github.com/ocornut/imgui/releases
// - Gallery .................... https://github.com/ocornut/imgui/issues?q=label%3Agallery (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
// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings + backends for various tech/engines)
// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
// - 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)
// - Web version of the Demo .... https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html (w/ source code browser)
// For first-time users having issues compiling/linking/running:
// For FIRST-TIME users having issues compiling/linking/running:
// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there.
// Since 1.92, we encourage font loading questions to also be posted in 'Issues'.
@@ -123,7 +124,7 @@ CODE
Designed primarily for developers and content-creators, not the typical end-user!
Some of the current weaknesses (which we aim to address in the future) includes:
- Doesn't look fancy.
- Doesn't look fancy by default.
- Limited layout features, intricate layouts are typically crafted in code.
@@ -148,7 +149,8 @@ CODE
- Ctrl+Z Undo.
- Ctrl+Y or Ctrl+Shift+Z: Redo.
- ESCAPE: Revert text to its original value.
- On OSX, controls are automatically adjusted to match standard OSX text editing 2ts and behaviors.
- On macOS, controls are automatically adjusted to match standard macOS text editing and behaviors.
(for 99% of shortcuts, Ctrl is replaced by Cmd on macOS).
- KEYBOARD CONTROLS
- Basic:
@@ -201,7 +203,7 @@ CODE
READ FIRST
----------
- Remember to check the wonderful Wiki (https://github.com/ocornut/imgui/wiki)
- Remember to check the wonderful Wiki: https://github.com/ocornut/imgui/wiki
- Your code creates the UI every frame of your application loop, if your code doesn't run the UI is gone!
The UI can be highly dynamic, there are no construction or destruction steps, less superfluous
data retention on your side, less state duplication, less state synchronization, fewer bugs.
@@ -5720,22 +5722,6 @@ void ImGui::NewFrame()
g.HoverItemDelayTimer = g.HoverItemDelayClearTimer = 0.0f; // May want a decaying timer, in which case need to clamp at max first, based on max of caller last requested timer.
}
// Drag and drop
g.DragDropAcceptIdPrev = g.DragDropAcceptIdCurr;
g.DragDropAcceptIdCurr = 0;
g.DragDropAcceptFlagsPrev = g.DragDropAcceptFlagsCurr;
g.DragDropAcceptFlagsCurr = ImGuiDragDropFlags_None;
g.DragDropAcceptIdCurrRectSurface = FLT_MAX;
g.DragDropWithinSource = false;
g.DragDropWithinTarget = false;
g.DragDropHoldJustPressedId = 0;
if (g.DragDropActive && IsKeyPressed(ImGuiKey_Escape, ImGuiInputFlags_None, g.ActiveId)) // Also works when g.ActiveId==0 (aka leftover payload in progress, no active id)
{
ClearActiveID();
ClearDragDrop();
}
g.TooltipPreviousWindow = NULL;
// Close popups on focus lost (currently wip/opt-in)
//if (g.IO.AppFocusLost)
// ClosePopupsExceptModals();
@@ -5748,6 +5734,30 @@ void ImGui::NewFrame()
//IM_ASSERT(g.IO.KeyAlt == IsKeyDown(ImGuiKey_LeftAlt) || IsKeyDown(ImGuiKey_RightAlt));
//IM_ASSERT(g.IO.KeySuper == IsKeyDown(ImGuiKey_LeftSuper) || IsKeyDown(ImGuiKey_RightSuper));
// Drag and drop
g.DragDropAcceptIdPrev = g.DragDropAcceptIdCurr;
g.DragDropAcceptIdCurr = 0;
g.DragDropAcceptFlagsPrev = g.DragDropAcceptFlagsCurr;
g.DragDropAcceptFlagsCurr = ImGuiDragDropFlags_None;
g.DragDropAcceptIdCurrRectSurface = FLT_MAX;
g.DragDropWithinSource = false;
g.DragDropWithinTarget = false;
g.DragDropHoldJustPressedId = 0;
if (g.DragDropActive)
{
// Also works when g.ActiveId==0 (aka leftover payload in progress, no active id)
// You may disable this externally by hijacking the input route:
// 'if (GetDragDropPayload() != NULL) { Shortcut(ImGuiKey_Escape, ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverActive); }
// but you will not get a return value from Shortcut() due to ActiveIdUsingAllKeyboardKeys logic. You can however poll IsKeyPressed(ImGuiKey_Escape) afterwards.
ImGuiID owner_id = g.ActiveId ? g.ActiveId : ImHashStr("##DragDropCancelHandler");
if (Shortcut(ImGuiKey_Escape, ImGuiInputFlags_RouteGlobal, owner_id))
{
ClearActiveID();
ClearDragDrop();
}
}
g.TooltipPreviousWindow = NULL;
// Update keyboard/gamepad navigation
NavUpdate();
@@ -14596,11 +14606,17 @@ void ImGui::NavUpdateCreateMoveRequest()
{
ImRect nav_rect_rel = !window->NavRectRel[g.NavLayer].IsInverted() ? window->NavRectRel[g.NavLayer] : ImRect(0, 0, 0, 0);
scoring_rect = WindowRectRelToAbs(window, nav_rect_rel);
if (scoring_page_offset_y != 0.0f)
if (g.NavMoveFlags & ImGuiNavMoveFlags_IsPageMove)
{
// When we start from a visible location, score visible items and prioritize this result.
if (window->InnerRect.Contains(scoring_rect))
g.NavMoveFlags |= ImGuiNavMoveFlags_AlsoScoreVisibleSet;
g.NavScoringNoClipRect = scoring_rect;
scoring_rect.TranslateY(scoring_page_offset_y);
if (scoring_page_offset_y != 0.0f)
g.NavScoringNoClipRect.Add(scoring_rect);
}
//GetForegroundDrawList()->AddRectFilled(scoring_rect.Min - ImVec2(1, 1), scoring_rect.Max + ImVec2(1, 1), IM_COL32(255, 100, 0, 80)); // [DEBUG] Pre-bias
if (g.NavMoveSubmitted)
NavBiasScoringRect(scoring_rect, window->RootWindowForNav->NavPreferredScoringPosRel[g.NavLayer], g.NavMoveDir, g.NavMoveFlags);
@@ -14852,14 +14868,14 @@ static float ImGui::NavUpdatePageUpPageDown()
nav_scoring_rect_offset_y = -page_offset_y;
g.NavMoveDir = ImGuiDir_Down; // Because our scoring rect is offset up, we request the down direction (so we can always land on the last item)
g.NavMoveClipDir = ImGuiDir_Up;
g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet | ImGuiNavMoveFlags_IsPageMove;
g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_IsPageMove; // ImGuiNavMoveFlags_AlsoScoreVisibleSet may be added later
}
else if (IsKeyPressed(ImGuiKey_PageDown, true))
{
nav_scoring_rect_offset_y = +page_offset_y;
g.NavMoveDir = ImGuiDir_Up; // Because our scoring rect is offset down, we request the up direction (so we can always land on the last item)
g.NavMoveClipDir = ImGuiDir_Down;
g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet | ImGuiNavMoveFlags_IsPageMove;
g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_IsPageMove; // ImGuiNavMoveFlags_AlsoScoreVisibleSet may be added later
}
else if (home_pressed)
{

25
imgui.h
View File

@@ -1,35 +1,36 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (headers)
// Help:
// - See links below.
// - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. All applications in examples/ are doing that.
// - Read top of imgui.cpp for more details, links and comments.
// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including this file (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
// - Add '#define IMGUI_DEFINE_MATH_OPERATORS' before including imgui.h (or in imconfig.h) to access courtesy maths operators for ImVec2 and ImVec4.
// Resources:
// - 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
// - Releases & Changelog ....... https://github.com/ocornut/imgui/releases
// - Gallery .................... https://github.com/ocornut/imgui/issues?q=label%3Agallery (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
// - Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings (language bindings + backends for various tech/engines)
// - Debug Tools https://github.com/ocornut/imgui/wiki/Debug-Tools
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
// - 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)
// - Web version of the Demo .... https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html (w/ source code browser)
// For first-time users having issues compiling/linking/running/loading fonts:
// For FIRST-TIME users having issues compiling/linking/running:
// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there.
// EVERYTHING ELSE should be asked in 'Issues'! We are building a database of cross-linked knowledge there.
// Since 1.92, we encourage font loading questions to also be posted in 'Issues'.
// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.92.5 WIP"
#define IMGUI_VERSION_NUM 19247
#define IMGUI_VERSION "1.92.5"
#define IMGUI_VERSION_NUM 19250
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
#define IMGUI_HAS_VIEWPORT // In 'docking' WIP branch.
@@ -1010,7 +1011,7 @@ namespace ImGui
// Disabling [BETA API]
// - Disable all user interactions and dim items visuals (applying style.DisabledAlpha over current colors)
// - Those can be nested but it cannot be used to enable an already disabled section (a single BeginDisabled(true) in the stack is enough to keep everything disabled)
// - Tooltips windows by exception are opted out of disabling.
// - Tooltips windows are automatically opted out of disabling. Note that IsItemHovered() by default returns false on disabled items, unless using ImGuiHoveredFlags_AllowWhenDisabled.
// - BeginDisabled(false)/EndDisabled() essentially does nothing but is provided to facilitate use of boolean expressions (as a micro-optimization: if you have tens of thousands of BeginDisabled(false)/EndDisabled() pairs, you might want to reformulate your code to avoid making those calls)
IMGUI_API void BeginDisabled(bool disabled = true);
IMGUI_API void EndDisabled();
@@ -1497,7 +1498,7 @@ enum ImGuiHoveredFlags_
// Tooltips mode
// - typically used in IsItemHovered() + SetTooltip() sequence.
// - this is a shortcut to pull flags from 'style.HoverFlagsForTooltipMouse' or 'style.HoverFlagsForTooltipNav' where you can reconfigure desired behavior.
// e.g. 'TooltipHoveredFlagsForMouse' defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort'.
// e.g. 'HoverFlagsForTooltipMouse' defaults to 'ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_AllowWhenDisabled'.
// - for frequently actioned or hovered items providing a tooltip, you want may to use ImGuiHoveredFlags_ForTooltip (stationary + delay) so the tooltip doesn't show too often.
// - for items which main purpose is to be hovered, or items with low affordance, or in less consistent apps, prefer no delay or shorter delay.
ImGuiHoveredFlags_ForTooltip = 1 << 12, // Shortcut for standard flags when using IsItemHovered() + SetTooltip() sequence.

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (demo code)
// Help:
@@ -5409,7 +5409,7 @@ static void DemoWindowPopups()
if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id
{
selected = n;
ImGui::Text("This a popup for \"%s\"!", names[n]);
ImGui::Text("This is a popup for \"%s\"!", names[n]);
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
@@ -8755,11 +8755,11 @@ void ImGui::ShowUserGuide()
ImGuiIO& io = GetIO();
BulletText("Double-click on title bar to collapse window.");
BulletText(
"Click and drag on lower corner to resize window\n"
"(double-click to auto fit window to its contents).");
"Click and drag on lower corner or border to resize window.\n"
"(double-click to auto fit window to its contents)");
BulletText("Ctrl+Click on a slider or drag box to input value as text.");
BulletText("Tab/Shift+Tab to cycle through keyboard editable fields.");
BulletText("Ctrl+Tab to select a window.");
BulletText("Ctrl+Tab/Ctrl+Shift+Tab to focus windows.");
if (io.FontAllowUserScaling)
BulletText("Ctrl+Mouse Wheel to zoom window contents.");
BulletText("While inputting text:\n");
@@ -8772,10 +8772,10 @@ void ImGui::ShowUserGuide()
Unindent();
BulletText("With keyboard navigation enabled:");
Indent();
BulletText("Arrow keys to navigate.");
BulletText("Arrow keys or Home/End/PageUp/PageDown to navigate.");
BulletText("Space to activate a widget.");
BulletText("Return to input text into a widget.");
BulletText("Escape to deactivate a widget, close popup, exit child window.");
BulletText("Escape to deactivate a widget, close popup,\nexit a child window or the menu layer, clear focus.");
BulletText("Alt to jump to the menu layer of a window.");
Unindent();
}

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (drawing and font code)
/*

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (internal structures/api)
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (tables and columns code)
/*

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.92.5 WIP
// dear imgui, v1.92.5
// (widgets code)
/*