Commit Graph

4755 Commits

Author SHA1 Message Date
ocornut
e3bd9434b1 1.86 WIP + internals: tweaks table temp data code. 2021-10-14 16:58:14 +02:00
ocornut
29653273c1 Docking: reinstate io.ConfigDockingWithShift option. (#4643)
This more or less reverts commit 3ed07a8f0b.
2021-10-13 16:47:29 +02:00
ocornut
1b215ecb01 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
#	imgui.cpp
2021-10-11 19:25:50 +02:00
ocornut
55d35d8387 Version 1.85 2021-10-11 19:24:25 +02:00
ocornut
75c54e6384 Nav: Fixed vertical scoring offset when wrapping on Y in a decorated window. 2021-10-11 14:40:47 +02:00
ocornut
ba5c105c01 Menus: Fixed an assertion happening in some situations when closing nested menus (broken in 1.83). (#4640)
Broken since 936f5322
Weirdly chain-reaction caused by the fact following #4640 repro, the SourceWindow assignment in OpenPopupEx() picks Menu_04 before its closure. Value of SourceWindow since bda2cde6 #2517
2021-10-11 11:48:39 +02:00
ocornut
44f801186f SetItemDefaultFocus() use ScrollToRectEx(), don't tab when Alt is held either, TabItemEx() uses ItemAdd's extra_flags, misc comments. 2021-10-08 15:24:54 +02:00
ocornut
31d033c9d8 Nav: refactor SetKeyboardFocusHere() into using Nav facility. Fix it for clipped items. (#343, #4079, #2352, #432)
+ Removed references to counter used by previous implementation of SetKeyboardFocus functions (the TabStop ones will be removed after)
2021-10-06 18:42:11 +02:00
ocornut
fbe78b1a3a Stack Tool: Docs (#4631) + also prevent Metrics window from displaying twice. 2021-10-06 18:22:40 +02:00
ocornut
1780579403 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
2021-10-06 17:57:11 +02:00
ocornut
2de96c4bd5 Stack Tool: Added Stack Tool (ShowStackToolWindow() function and available from Demo and Metrics window). (#4631) 2021-10-06 17:47:27 +02:00
ocornut
164a86d3b0 Moved !IsActiveIdUsingKey(ImGuiKey_Tab) check to UpdateTabFocus(). Added asserts to IsItemHovered() and IsWindowHovered(). 2021-10-05 22:06:12 +02:00
ocornut
8f495e5543 Internal: added ScrollToItem() upcoming replacement to ScrollToBringRectIntoView() + ImGuiScrollFlags (WIP) (#3692, #3208, #2812, #4242, #2900) 2021-09-29 17:13:45 +02:00
ocornut
835a5344b0 Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_win32.cpp
#	imgui.cpp
#	imgui.h
#	imgui_demo.cpp
#	imgui_internal.h
2021-09-24 15:49:28 +02:00
ocornut
65ad63de84 Added ImGuiFocusedFlags_NoPopupHierarchy and ImGuiHoveredFlags_NoPopupHierarchy (followup #4527)
IsWindowFocused: fix flag usage (amend 6b1e094c) was technically harmless because of light typing.
2021-09-24 15:41:30 +02:00
ocornut
fc4988ffb0 Added ImGuiFocusedFlags_NoPopupHierarchy and ImGuiHoveredFlags_NoPopupHierarchy (followup #4527) 2021-09-24 15:39:38 +02:00
ocornut
24a77824f2 Added ClosePopupsExceptModals() helper, unused for now (aimed at user being able to close popups on app focus loss, not necessarily a suitable default) 2021-09-22 15:50:40 +02:00
ocornut
bbb95a5e06 IO: modify io.AddFocusEvent() to tolerate in/out for multi-viewports. Amend 2f40be6. (merged from docking) (#3532) 2021-09-22 15:47:53 +02:00
ocornut
15132217a3 Nav: Fixed an issue with losing focus on docked windows when pressing Alt while keyboard navigation is disabled. (#4547, #4439) 2021-09-21 14:17:49 +02:00
ocornut
fa0a314f59 Nav: Fixed an issue with losing focus on docked windows when pressing Alt while keyboard navigation is disabled. (#4547, #4439) 2021-09-21 13:16:00 +02:00
ocornut
2cffcbdc64 InputText: fix Space key with nav enabled interfering with input text boxes (fix bd6c9e99). made it possible to activate InputText with tweak gamepad button (why not, now that we can cancel) (#4552, #2321) 2021-09-17 16:30:32 +02:00
ocornut
3973de7933 Internals: removed last parameter to IsClippedEx() + fix PVS studio warnings. 2021-09-16 18:07:17 +02:00
ocornut
2d0a6a4969 Misc: moved StacSizeOnBegin out of window instance into window stack data. 2021-09-15 15:36:03 +02:00
ocornut
66cd21db88 Misc: extracted ErrorCheckEndWindowRecover() out of ErrorCheckEndFrameRecover(). (#1651) 2021-09-15 15:26:29 +02:00
ocornut
d366694062 Disabled: Added assert guard for mismatching BeginDisabled()/EndDisabled() blocks. (#211) + Added asserts for missing PopItemFlag() calls. Added both to ErrorCheckEndFrameRecover (#1651) 2021-09-15 15:26:29 +02:00
ocornut
e7cc534367 Docking: Improved resizing system so that non-central zone are better at keeping their fixed size. 2021-09-14 17:57:47 +02:00
ocornut
29828d0469 Docking: floating node with a central node hides properly when nothing is docked + rename. 2021-09-14 17:56:09 +02:00
ocornut
8dfb52245b Docking: bits. 2021-09-13 20:40:30 +02:00
ocornut
5d95e7eef9 Viewports: extracted DestroyViewport() out of UpdateViewportsNewFrame() function. 2021-09-11 14:06:43 +02:00
ocornut
92a39f78b9 Fixed IsWindowFocused/IsWindowHovered with _ChildWindows for not following through popup parents (amend 6b1e094c, fix #4527) 2021-09-11 14:06:10 +02:00
ocornut
79d39b190b Viewports: fix window with viewport ini data immediately merged into a host viewport from leaving a temporary viewport alive for a frame (would leak into backend). 2021-09-10 15:05:17 +02:00
ocornut
6b77668171 Viewports: Fixed a crash while a window owning its viewport disappear while being dragged.
t would manifest when e.g. reconfiguring dock nodes while dragging.
2021-09-09 21:05:40 +02:00
ocornut
9a49c1ddbd Viewports: fixed unnecessary creation of temporary viewports when multiple docked windows got reassigned to a new node (created mid-frame) which already has a HostWindow 2021-09-09 20:51:53 +02:00
ocornut
6b1e094cfb Fixed _ChildWindows from leaking docking hierarchy. Added ImGuiFocusedFlags_DockHierarchy and ImGuiHoveredFlags_DockHierarchy. 2021-09-08 19:10:25 +02:00
ocornut
cfb837203c Internals: refactored IsWindowHovered()/IsWindowFocused() to make their logic more similar + change underlying value of ImGuiHoveredFlags_AllowWhenBlockedByPopup + comment out docking only flags. 2021-09-08 16:45:24 +02:00
ocornut
321b84f01f Internals: refactored IsWindowHovered()/IsWindowFocused() to make their logic more similar + change underlying value of ImGuiHoveredFlags_AllowWhenBlockedByPopup + comment out docking only flags. 2021-09-08 16:44:53 +02:00
ocornut
fa9fc05ac6 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
2021-09-07 18:20:12 +02:00
ocornut
d9b427cce0 Nav: clarified/renamed NavInputId as NavAcivateInputId, added flags shared by both.
(this commit should have no visible side effect but is designed to introduce the followup commit refactoring SetKeyboardFocusHere into using a Nav request)
2021-09-07 18:10:31 +02:00
ocornut
607ad8c949 Drag and Drop: Fixed using BeginDragDropSource() within a Begin()/BeginChild() that returned false. (#4515) + BeginDragDropTarget()
Note how 79ae6d3b adedd a SkipItems test in BeginDragDropTargetCustom() only.
Catching this similar to work needed to neatly represent the error in #4375 #4158, #4008, #2562
2021-09-06 20:59:16 +02:00
ocornut
ade4c15eea Nav: Tidying up, renaming + update AnyRequest flag in NavMoveRequestSubmit(). 2021-09-03 16:35:41 +02:00
ocornut
5ee40c8d34 Nav: always disable highlight if nav is disabled, fix for IMGUI_DEBUG_NAV_SCORING, minor renaming. 2021-09-02 12:05:32 +02:00
ocornut
dff15acdb5 Nav: Fixed toggling menu layer with Alt exiting menu layer with Esc not moving mouse when NavEnableSetMousePos config flag is set. 2021-09-01 16:05:03 +02:00
ocornut
3d9d3b49ae Internals: folded ImGuiItemAddFlags into ImGuiItemFlags. ImGuiItemAddFlags_Focusable > ImGuiItemFlags_Inputable. One step in the big nav/tab/focus rework.
Bonus simplified Selectable() handling of its custom disabled flag. (#211)
2021-09-01 14:46:08 +02:00
ocornut
73a5e82e04 Nav: removed parameters from NavScoreItem(), NavProcessItem(), NavApplyItemToResult(): made little sense / misleading because pulling from other current state anyway.
Will readd in a more thorough manner is actually needed.
2021-09-01 14:13:40 +02:00
ocornut
a735a8c084 Nav: storing NavRect in LastItemData. Fix race condition where framed items (Rect != NavRect) calling SetFocusID() would store the wrong NavRectRel until next frame
(haven't dugged in the possible side-effects of that race condition)
2021-09-01 12:12:51 +02:00
ocornut
ee351d3548 Nav: move code into NavMoveRequestSubmit(). NavApplyItemToResult() takes absolute rect., comments 2021-09-01 12:06:15 +02:00
ocornut
7b913db1ce Nav: split NavMoveRequest into NavMoveSubmitted + NavMoveScoringItems to allow operation to defer a move request and provide result immediately + fix regular scoring needlesly running during init + some renaming. 2021-08-31 18:19:52 +02:00
ocornut
53589092b2 Docking: warning fix for when IM_ASSERT() is empty 2021-08-31 13:49:11 +02:00
ocornut
dedb381c51 Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_opengl3.cpp
#	examples/imgui_examples.sln
#	imgui.cpp
#	imgui.h
2021-08-30 20:01:16 +02:00
ocornut
4aea1c5adb IO: added io.WantCaptureMouseAllowPopupClose (#4480) + comments 2021-08-30 19:11:47 +02:00
ocornut
66102880a3 Updated links to Discussions 2021-08-30 17:06:51 +02:00
ocornut
333807b483 Windows: fixed background order of overlapping childs submitted sequentially. (#4493)
Amend 07704496
2021-08-30 13:08:41 +02:00
ocornut
0eb45a0577 Docking: fix 58f5092 (#4310)
If we clear _ChildWindow flag we must remove it from here otherwise render loop will fail.
2021-08-27 21:29:27 +02:00
ocornut
bb6a60b1ff Nav: extracted sections of NavUpdate() into a NavUpdateCreateMoveRequest() function. Only clearing results when a request is activated. 2021-08-27 21:10:16 +02:00
ocornut
ccfb20095e Nav: small refactor of forwarding, clarified that MoveDir only set when RequestActive, removed one indent level in NavUpdatePageUpPageDown(). 2021-08-27 20:48:01 +02:00
ocornut
20a1edef89 Nav: made EndMenuBar() use NavMoveRequestForward() for consistency. Moved forward clearing to NavMoveRequestApplyResult(). Improved/fixed comments. 2021-08-27 17:21:10 +02:00
ocornut
84890a3074 Nav: simplify wrap requests code (may soon be useable for tabbing) 2021-08-27 12:31:11 +02:00
ocornut
4c31c98d22 Nav: extracted code out of NavUpdate() into NavUpdateCancelRequest() 2021-08-27 12:30:55 +02:00
ocornut
58f5092c53 Docking: fixed settings load issue when mouse wheeling. (#4310) 2021-08-24 20:33:00 +02:00
ocornut
e23bee353c Removed GetWindowContentRegionWidth() function 2021-08-23 16:15:16 +02:00
ocornut
0649f750b4 Version 1.85 WIP 2021-08-23 15:31:06 +02:00
ocornut
d79ca9b0b6 Fixed nested BeginDisabled()/EndDisabled() calls. (#211, #4452, #4453, #4462) [Legulysse] 2021-08-23 14:57:54 +02:00
ocornut
47fb332fb2 Fix BeginDisabled(false), again, (#211, #4452, #4453) Version 1.84.1
(forced pushed since our earlier versioning didn't sort correctly in github web)

# Conflicts:
#	docs/CHANGELOG.txt
2021-08-21 00:00:27 +02:00
ocornut
32d4f6c5d9 Fix BeginDisabled(false), again, (#211, #4452, #4453) Version 1.84.1
(forced pushed since our earlier versioning didn't sort correctly in github web)
2021-08-20 23:59:46 +02:00
ocornut
2e01952b35 Fix BeginDisabled(false), (#211, #4452) 2021-08-20 20:31:17 +02:00
ocornut
f969e68c10 Fix BeginDisabled(false), (#211, #4452) 2021-08-20 20:30:51 +02:00
ocornut
5a7d18a441 Merge branch 'master' into docking
# Conflicts:
#	docs/CHANGELOG.txt
2021-08-20 18:15:25 +02:00
ocornut
d2ffbd9b86 Version 1.84
Fix PVS Studio false positive //-V1020
Fix missing #ifndef for IMGUI_IMPL_OPENGL_LOADER_CUSTOM path
2021-08-20 18:03:55 +02:00
ocornut
df2319a854 Small optimizations to BeginDisabled() to allow frequent calls (#211)
Not intended for frequent calls but I suspect some people will do it either way...
Rough/indicative: measured 0.1 ms for 5000 calls in release, 0.5 ms in debug on my desktop windows.
2021-08-20 17:19:18 +02:00
ocornut
c543d93af1 Expose BeginDisabled()/EndDisabled() in public API. Add to demo. (#211) 2021-08-20 16:34:43 +02:00
ocornut
9c3359ef39 IO: modify io.AddFocusEvent() to tolerate in/out for multi-viewports. Amend 2f40be6. (#3532) 2021-08-19 17:35:27 +02:00
ocornut
0b06c4b2b0 Merge branch 'master' into docking (will need further for io.AddFocusEvent)
# Conflicts:
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_opengl3.cpp
#	backends/imgui_impl_sdl.cpp
#	backends/imgui_impl_win32.cpp
#	imgui.cpp
2021-08-19 17:25:12 +02:00
ocornut
7bbf8f2ab0 Drag and Drop: fix using AcceptDragDropPayload() with ImGuiDragDropFlags_AcceptNoPreviewTooltip.
Window was not properly hidden in that case.
2021-08-18 15:40:22 +02:00
ocornut
cd39460925 IO: set io.KeyModsPrev in EndFrame() to tolerate backend writing to io.KeyMods without breaking. (#4439)
Amend ff428f1
2021-08-17 20:33:27 +02:00
thedmd
2f40be638f IO, Backends: add io.AddFocusEvent(). Clear pressed keys after loosing input focus (#3532)
Amend/fix #2445, #2696, #3751, #4377
2021-08-17 20:10:45 +02:00
Rokas Kupstys
86afe966d3 Metrics: Fixed a crash when inspecting the individual draw command of a foreground drawlist. 2021-08-17 16:23:26 +02:00
ocornut
ff428f1d2f Nav: Fix not clearing NavWindowingToggleLayer properly (old code left it to true, relied on Alt release only). Removed unnecessary KeyMenu_ from NavInput. (#4439, #787) 2021-08-17 12:54:51 +02:00
ocornut
8fa502ca42 Nav: Alt doesn't toggle menu layer if other modifiers are held. (#4439) 2021-08-17 12:23:54 +02:00
ocornut
f9b5168fb3 Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_sdl.cpp
#	backends/imgui_impl_win32.cpp
#	imgui.cpp
2021-08-02 16:00:50 +02:00
ocornut
b846969fe1 Removed unnecessary line in Begin() + commented out redirecting functions/enums names that were marked obsolete in 1.67 and 1.69 + readded commented obsoleted function. 2021-07-26 12:22:48 +02:00
Rokas Kupstys
3e4c89051d Popups: Fix OpenPopup() being called after BeginPopup() resulting in a failure to open a popup when focus is NULL. (#4308)
Story of removed line begins in commit b80cf0a. It's purpose was to close popups when they lost focus.
Later on few other changes were introduced:
* bcc49ff - closing popups with RMB without changing window focus
* af679a1 - closing popups in FocusWindow()
These two changes covered all the cases of popup closing which made deleted line obsolete. Conveniently, now all popup closing is handled from within UpdateMouseMovingWindowEndFrame() either by calling FocusWindow() or ClosePopupsOverWindow().
2021-07-26 11:43:39 +02:00
ocornut
7bfc379a23 Merge branch 'master' into docking
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2021-07-19 21:58:06 +02:00
ocornut
c881667c00 Fix - amend 1ad1530 (range-select branch need the NextItemData in NavProcessItem) 2021-07-19 21:45:44 +02:00
ocornut
90bf996e1a Internals: widgets always read back from g.LastItemData.InFlags (so we can now modify per-item disable state more easily). (#211) 2021-07-19 21:26:34 +02:00
ocornut
6b8a059fc9 Internals: moved LastItem data to a shared structure (instead of one per window)
(should be a no-op as we are restoring things in Begin/End. Toward faciliate backup/restore of LastItemData and favor pulling from here instead of CurrentItemFlags, toward #211)
2021-07-19 21:25:47 +02:00
ocornut
1ad153056a Internals: ItemAdd: set LastItemXXX fields before navigation calls + comments about io.IniFilename (#4294) 2021-07-19 21:24:15 +02:00
ocornut
fb4bbeb033 Disabled: fixed IsItemHovered() if popped disabled state after item, or when using Selectable_Disabled. (#211) 2021-07-12 15:43:17 +02:00
ocornut
246ad6c03c Disabled: items more consistently release active id if the active item got disabled. (#211) (amend 2952525) 2021-07-12 15:39:47 +02:00
ocornut
638e1a721b Disabled: fixed IsItemHovered() returning true on disabled item when navigated to. (#211) 2021-07-12 15:01:02 +02:00
ocornut
a11f36811f Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_dx10.cpp
#	backends/imgui_impl_dx11.cpp
#	backends/imgui_impl_dx12.cpp
#	backends/imgui_impl_dx9.cpp
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_opengl3.cpp
#	backends/imgui_impl_sdl.cpp
#	backends/imgui_impl_vulkan.cpp
#	backends/imgui_impl_win32.cpp
#	imgui.cpp
#	imgui_internal.h
2021-07-09 20:16:19 +02:00
Rokas Kupstys
5dd1e38b7a Disabled: disabled items set HoveredId, allowing e.g. HoveredIdTimer to function. (#211, #3419) + Menus: fix hovering a disabled menu or menu item not closing other menus.
Rework of https://github.com/rokups/imgui/commit/c24b470
Note that the declared intent of that commit "Prevents window from being dragged if mouse hovers a disabled item." was already fullfilled by a876ad87.
Changes in ButtonBehavior() not needed anymore since ImGuiButtonFlags_Disabled is gone
2021-07-09 19:54:46 +02:00
ocornut
4a100f7f11 Nav: Disabled items are not candidate for default focus. (#211, #787) + simplify handling of ImGuiButtonFlags_PressedOnDragDropHold path. 2021-07-09 18:57:23 +02:00
ocornut
cc40ae2101 PushDisabled(): added bool + clarify support for stacked disabled (#211) 2021-07-08 19:21:59 +02:00
ocornut
30d164eb26 Backends: Win32: IME functions are disabled by default for non-Visual Studio compilers (MinGW etc.) (#2590, #738, #4185, #4301)
Enable with '#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS' for those compilers. Undo change from 1.82.
2021-07-08 14:23:31 +02:00
ocornut
3512f2c2c2 Internals: Menus: minor tidying up + renaming in ImGuiMenuColumns + removing extraneous offset field which is always zero + using smaller types.
sizeof() 36 -> 20
2021-07-07 20:16:55 +02:00
ocornut
eb6f4b1a6a Docking: Fix crash when a dock node gets re-qualified as dockspace>floating>dockspace.. (#3203, #4295)
Which tends to happen when incorrectly calling DockBuilderAddNode() without ImGuiDockNodeFlags_Dockspace and using it as a Dockspace on the next frame after the floating window hosting the node has been automatically created.
2021-07-07 18:22:55 +02:00
ocornut
cd4cc9ff0d Docking: Fixed crash issues using DockBuilderRemoveNode() in some situations. (#3111, #3179, #3203, #4295)
If the deleted root node isn't part of a dockspace with a central node, it won't be "protected" but removed when last window gets removed.
2021-07-07 16:39:39 +02:00
ocornut
9e8e5ac363 Docking: Added ImGuiDockNodeFlags_NoDockingOverEmpty. Breaking definition of ImGuiDockNodeFlags_NoDockingOverOther which now means "non empty node". (#3492, #2648, #4292) 2021-07-05 13:32:36 +02:00
ocornut
6136b3844b Docking: Reworked node flags saving/inheritance... (#4292, #3834, #3633, #3521, #3492, #3335, #2999, #2648)
..so that flags enforced by docked windows via the DockNodeFlagsOverrideSet mechanism are are not left in empty dockspace nodes once the windows gets undocked.
2021-07-05 13:31:34 +02:00
ocornut
0a8ab75e4b Docking: removed DockNodeFlagsOverrideClear flags from ImGuiWindowClass. (#2999, #3521, #3633)
+ extraded bits of metrics into DebugNodeDockNodeFlags()
2021-07-05 12:58:33 +02:00