Commit Graph

4546 Commits

Author SHA1 Message Date
ocornut
85513de247 Internals, Inputs: *Breaking* Swapped parameter order of owner-aware versions of IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(). (#456)
For several reasons those changes makes sense. They are being made because making some of those API public.
Only past users of imgui_internal.h with the extra parameters will be affected.
Added asserts for valid flags in various functions to detect _some_ misuses, BUT NOT ALL.
Amend 4448d975 (#456, #2637, #2620, #2891, #3370, #4828, #5108, #5242, #5641)
2024-05-23 16:57:03 +02:00
ocornut
900b29055c Internals, Inputs: *Breaking* Swapped parameter order of Shortcut(). (#456)
Amend 4448d975 (#456, #2637, #2620, #2891, #3370, #4828, #5108, #5242, #5641)
2024-05-23 16:57:03 +02:00
ocornut
55748cdbe1 Internals, Inputs: *Breaking* Renamed ImGuiKeyOwner_None to ImGuiKeyOwner_NoOwner: avoid confusion with non zero value, makes IsKeyPressed() calls using ImGuiKeyOwner_NoOwner more explicit.
Amend 4448d975 (#456, #2637, #2620, #2891, #3370, #4828, #5108, #5242, #5641)
2024-05-23 16:57:03 +02:00
ocornut
aa725ca79d Inputs: moving ImGuiInputFlags_RouteAlways into ImGuiInputFlags_RouteTypeMask_ 2024-05-21 12:28:47 +02:00
ocornut
28a283b460 Windows: BeginChild(), Tables:fixed visibility of fully clipped child windows and tables to Test Engine. 2024-05-21 11:06:40 +02:00
Eugene Sandulenko
aa5a6098ee
Fixed typos in comments (#7599) 2024-05-18 17:10:36 +02:00
ocornut
d39ca33b63 Fixed false positive with PVS-Studio.
Amend ae8218a.
2024-05-17 17:13:55 +02:00
ocornut
ae8218a3ea Inputs, Shortcut: fixes some edge cases for GetKeyChordName(), clarify that it is aimed at display. (#456)
Rename IsNamedKeyOrModKey() to IsNamedKeyOrMod() for consistency.
Fixed GetKeyName(ImGuiKey_None) from returning "N/A" or "None" depending on IMGUI_DISABLE_OBSOLETE_KEYIO.
See "inputs_keychord_name" in imgui_test_suite.
2024-05-17 17:07:50 +02:00
ocornut
25e279ee73 Inputs: Treat ctrl-left-click as right click when ConfigMacOSXBehaviors is set. (#2343) 2024-05-17 15:26:34 +02:00
ocornut
b4f564c1ed Internals: Shortcuts: *Breaking* : rename ImGuiInputFlags_RouteGlobalLow -> ImGuiInputFlags_RouteGlobal, ImGuiInputFlags_RouteGlobal -> ImGuiInputFlags_RouteGlobalOverFocused, ImGuiInputFlags_RouteGlobalHigh -> ImGuiInputFlags_RouteGlobalHighest (#456) 2024-05-17 14:18:22 +02:00
ocornut
5107e58b0f Inputs: amend changelog and clarify how the swap might be a breaking change for a minority of users. (#2343) 2024-05-16 19:56:29 +02:00
ocornut
8bd5d1d42f Inputs: Fixed swapping of keys associated to mods. Fixed warnings. (#2343, #4084, #5923, #456)
Amend 7747106.
2024-05-16 19:23:05 +02:00
ocornut
7747106647 Inputs: swap Ctrl and Cmd on macOS X, remove ImGuiMod_Shortcut. (#2343, #4084, #5923, #456) 2024-05-16 19:16:55 +02:00
Hubert Maier
07dbcf1f70 Fixed typos. (#7593) 2024-05-16 16:13:01 +02:00
ocornut
5d973a87d4 Backends: SDL_Renderer2/SDL_Renderer3: and ImGui_ImplSDLRenderer2_RenderDrawData() and ImGui_ImplSDLRenderer3_RenderDrawData() now takes a SDL_Renderer* parameter. 2024-05-15 13:44:54 +02:00
Erin M
af2fbf043d
Backends/Internals: Don't use IME and clipboard default win32 functions when WINAPI_FAMILY_GAMES (#7585) 2024-05-15 11:42:56 +02:00
ocornut
e4576914cb Internals: amend f806c76 to better match docking + fixed unused static forward declaration warning. 2024-05-14 16:22:27 +02:00
ocornut
d0524df887 Internals: slight refactor FindHoveredWindow() -> FindHoveredWindowEx() toward reducing far-away code duplication. 2024-05-14 16:03:00 +02:00
ocornut
f806c76e97 Tables, Dpi: added dummy g.DpiScale storage (to be altered in docking), using to scale tables border hit thickness.
+ Added note about how equivalent resize padding for windows (sourced from WINDOWS_HOVER_PADDING) would need further rework.
2024-05-14 15:03:20 +02:00
ocornut
5e23680454 Backends: all backends + demo now call IMGUI_CHECKVERSION() to verify ABI compatibility between caller code and compiled version of dear imgui. (#7568) 2024-05-13 15:07:13 +02:00
ocornut
f48aae600a Version 1.90.7 WIP 2024-05-13 14:47:37 +02:00
ocornut
6ccc561a2a Version 1.90.6 2024-05-08 15:38:33 +02:00
ocornut
d4495446d5 Windows, Internal: added experimental SkipRefresh mode. (#3515, #4763, #7556, #5116 , #4076, #2749, #2268)
currently: ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags_TryToAvoidRefresh);
- This is NOT meant to replace frame-wide/app-wide idle mode.
- This is another tool: the idea that a given window could avoid refresh and reuse last frame contents.
- I think it needs to be backed by a careful and smart design overall (refresh policy, load balancing, making it easy and obvious to user).
- It's not there yet, this is currently a toy for experimenting.
My other issues with this:
- It appears to be very simple, but skipping most of Begin() logic will inevitably lead to tricky/confusing bugs. Let's see how it goes.
- I don't like very much that this opens a door to varying inconsistencies
- I don't like very much that it can lead us to situation where the lazy refresh gets disabled in bulk due to some reason (e.g. resizing a dock space) and we get sucked in the temptation to update for idle rather than update for dynamism.
2024-05-07 11:44:43 +02:00
ocornut
0b309471f2 Windows: Changed default ClipRect to extend to windows' left and right borders. (#3312, #7540, #3756, #6170, #6365) 2024-05-03 16:00:20 +02:00
ocornut
0c9c12c1bb InnerClipRect use ImFloor() matching docking branch (fix c41868531 for #6861, #2884, followed by rename 94da5842)
Since negative windows can never be visibile in master it didn't show as a difference.
2024-05-03 15:51:49 +02:00
ocornut
6ebbecc6a0 Realign assignments.
No functional changes.
2024-05-03 12:57:07 +02:00
thedmd
fc4d818e17 Tables: Angled headers: added TableAngledHeadersTextAlign, ImGuiStyleVar_TableAngledHeadersTextAlign. (#6917) 2024-05-03 12:54:59 +02:00
ocornut
4bb7567141 Tables: Angled headers: fixed multi-line label display when angle is flipped. (#6917) 2024-05-02 13:49:26 +02:00
ocornut
50b2ff0bf0 ImGuiIO: moved IMGUI_DISABLE_OBSOLETE_KEYIO block lower in the structure so other fields layout are not affected by it (#7534)
This is essentially a misleading grace feature allowing a build mistake to be made, as we technically are more flexible now. BUT if we reintroduce a need we may more harshly move it to the top of the structure to detect issues.
2024-04-30 10:23:03 +02:00
ocornut
fa0120ea5e Windows: Fixed subsequent Begin() append calls from setting last item information for title-bar. (#7506, #823)
Amend 067605052, 27fd1b913b
2024-04-18 21:17:12 +02:00
ocornut
361432a0bb TreeNode: fixed layout so that TreeNode("") or TreeNode("##HiddenLabel") may properly be used with SameLine(0,0). (#7505, #282)
Also adjust some of the interact_bb padding, arbitrary interact padding not meaningful as empty label is likely to be followed by extra item. User likely to use ImGuiTreeNodeFlags_SpanAvailWidth.
2024-04-18 20:50:00 +02:00
ocornut
eba46cb0d2 Drag and Drop: assert when nesting BeginDragDropSource() and BeginDragDropTarget() (#7504) + update Gallery links 2024-04-17 18:00:55 +02:00
ocornut
3caa79c8a5 Version 1.90.6 WIP 2024-04-15 11:27:07 +02:00
ocornut
76bc1b825e Extracted part of NewFrame() into SetupDrawListSharedData() for documentation purpose. (#7495, #6406)
Also changed g.Font->ContainerAtlas->Flags to g.IO.Fonts->Flags
2024-04-15 11:24:43 +02:00
ocornut
f790d51665 Silent zealous/stupid warning introduced by Clang 16 (shipping with VS2022) with -Weverything. Pointers are now illegal! 2024-04-12 16:55:32 +02:00
ocornut
231cbee0fc Version 1.90.5 2024-04-11 15:54:39 +02:00
ocornut
e7712ff103 Out of courtesy/consistency move all the DebugHookIdInfo compares into ifndef block. 2024-04-03 10:50:32 +09:00
ocornut
f959c417fe Refactor moving ID stack functions to their own section (part 2) 2024-04-03 10:48:32 +09:00
ocornut
0bf134a8e2 Refactor moving ID stack functions to their own section. 2024-04-03 10:42:57 +09:00
ocornut
9638c2839a Internals: adding ImGuiNavMoveFlags_NoClearActiveId even though there's currently no satisfying way to take advantage of it. (#1418) 2024-03-27 12:00:50 +09:00
ocornut
742e53434f Child Windows: adjust resizing limits to match window padding rather than inner clipping rectangle. (#7440) 2024-03-27 11:36:57 +09:00
cfillion
515b437c08 Child windows: look at the parent window's flags to decide whether to clamp child resizes. (#7440, #1710) 2024-03-27 11:24:07 +09:00
cfillion
976dc23965 Windows: extend outer resize borders to the edges when there are no corner grips. (#7440, #1710) 2024-03-27 11:01:14 +09:00
cfillion
cf4c10bef7 Style: added ImGuiStyleVar_TabBorderSize, ImGuiStyleVar_TableAngledHeadersAngle. (#7411) 2024-03-26 14:38:38 +09:00
cfillion
868facff9d ImDrawList: (Breaking) merge float radius_x/radius_y parameters into ImVec2 radius in PathEllipticalArcTo(), AddEllipse(), AddEllipseFilled(). (#2743, #7417) 2024-03-18 22:50:47 -07:00
ocornut
40df3db1a2 Tweaking terminology 2024-03-17 19:46:12 +09:00
ocornut
3c435c0297 Inputs: (Breaking) More formally obsoleted GetKeyIndex() when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is set. (#4921) 2024-03-08 12:16:24 +01:00
ocornut
286cd5bd41 Internals, InputText: removed ImGuiInputSource_Clipboard. (#4005)
Added by f08566b4d
2024-03-07 15:02:38 +01:00
ocornut
65dc67f63c Windows: Double-click to collapse may be disabled via key-ownership mechanism. (#7369) 2024-03-05 17:34:34 +01:00
ocornut
04f40014a6 Docs: added a mini wiki index in main source files. 2024-02-29 15:17:08 +01:00
ocornut
0573513d6d Windows: Scrollbar visibility decision uses current size when both size and contents size are submitted by API. (#7252) 2024-02-28 17:09:20 +01:00
ocornut
44c7dfca03 Menus, Popup: Amend c3f8f4d for static analyzer warning ("condition always true"). (#7325) 2024-02-27 19:42:20 +01:00
ocornut
c3f8f4de25 Menus, Popups: Fixed an issue where sibling menu popups re-opening in successive frames would erroneously close the window. (#7325, #7287, #7063)
Amend 014e0ac8
2024-02-27 18:36:46 +01:00
ocornut
9877941775 Popups, Menus: rename ImGuiPopupData::BackupNavWindow > RestoreNavWindow and minor tweaks. Should be functionally a no-op.
This is expected to clear the noise so next commit can be cleared to read. (#7325)
Last renamed in b3ea01d86
2024-02-27 17:56:51 +01:00
ocornut
e46d1e69ac Version 1.90.5 WIP 2024-02-26 13:31:10 +01:00
ocornut
277ae93c41 Version 1.90.4 2024-02-22 19:56:39 +01:00
ocornut
f5be90523d Nav: Fixed SetKeyboardFocusHere() or programmatic tabbing API from not working on windows with the ImGuiWindowFlags_NoNavInputs flag.
Amend/fix 13d91ff 3a078466
2024-02-22 19:43:03 +01:00
ocornut
13d91ff918 Nav: Fixed SetKeyboardFocusHere() or programmatic tabbing API from not working on windows with the ImGuiWindowFlags_NoNavInputs flag.
Amend/fix 3a078466a
2024-02-22 19:39:10 +01:00
ocornut
34965cf23a Modals: Temporary changes of ImGuiCol_ModalWindowDimBg are properly handled by BeginPopupModal(). (#7340)
+ Misc: Added optional alpha multiplier parameter to GetColorU32(ImU32) variant.
2024-02-22 14:53:33 +01:00
ocornut
659fb41d0a Debug Tools: moved DebugStartItemPicker() to public API. Added to Demo->Tools menu. (#2673) 2024-02-20 17:33:17 +01:00
ocornut
d3f1a7165c Popups: allow Child Popups to be resizable if not explicitly disabling. 2024-02-20 15:03:09 +01:00
ocornut
e78ce72eb6 Popups: Fixed resizable popup minimum size being too small. Standardized CalcWindowMinSize() logic a bit more. (#73290
Amend e2035a514, 623bff23ce, 923535240, etc.
2024-02-20 15:00:01 +01:00
ocornut
014e0ac8c9 Menus, Popups: Fixed an issue where hovering a parent-menu upward would erroneously close the window. (#7325, #7287, #7063)
Amend 76e09c4b0. Initial call to ClosePopupToLevel d31fe97f7 (#2880).
See "widgets_menu_reopen_2" in TestSuite.
2024-02-20 14:01:24 +01:00
Tim-Rex
9159cd7b4a
Updated invalid documentation link (#7331) 2024-02-18 12:51:32 +01:00
cvionis
ccc5347e45
Fix typos (#7332) 2024-02-18 12:50:51 +01:00
ocornut
8a14b71f22 Version 1.90.4 WIP 2024-02-15 16:51:57 +01:00
ocornut
5b6f03213d Version 1.90.3 2024-02-14 13:58:19 +01:00
ocornut
9dfa2397de Internals: Fixed ImFileOpen not working before context is created. (#7314, #7315)
Amend daf49e9d8
2024-02-14 11:02:24 +01:00
ocornut
3af739a2d1 Menus, Popups: fixed menus and popups with child window flag erroneously not displaying a scrollbar when contents is over parent viewport size. (#7287, #7063)
Amend f37f6f6
2024-02-12 15:21:48 +01:00
ocornut
915c6393ad Version 1.90.3 WIP 2024-02-12 14:54:48 +01:00
ocornut
536090303a Version 1.90.2 2024-02-09 16:59:31 +01:00
ocornut
7b5357d817 Debug Tools: Metrics: Improved Monitors and Viewports minimap display. Highlight on hover.
Added ImGuiViewport ID in Master branch.
2024-02-09 16:32:26 +01:00
ocornut
70aa717a8e Combo: Fixed not reusing windows optimally when used inside a popup stack. 2024-02-09 15:23:43 +01:00
ocornut
76e09c4b0f ClosePopupsOverWindow(): amend to remove _ChildWindow test.
Said test seems unnecessary and incorrect as we test hierarchy now. See test "nav_ctrl_tab_popups" in ImGuiTestSuite.
2024-02-08 17:08:01 +01:00
ocornut
3a078466a7 Nav: ImGuiWindowFlags_NoNavInputs is tested during scoring so NavFlattened windows can use it. 2024-02-08 16:06:55 +01:00
ocornut
a5e0e90c16 Nav: tweak RenderNavHighlight() syntax. ImGuiNavHighlightFlags_TypeThin -> ImGuiNavHighlightFlags_Compact. 2024-02-08 15:44:46 +01:00
ocornut
a06dd7a27b OpenPopup(): Added ImGuiPopupFlags_NoReopen. Nav, Menus: Fixed click on a BeginMenu() followed by right-arrow. (#1497, #1533)
reopen
2024-02-08 15:02:22 +01:00
ocornut
f104967c68 Comments 2024-02-08 12:10:14 +01:00
ocornut
06ce312745 InputText: Internal: added reload from user-buf feature. (#2890)
Very highly requested feature (#6962, #5219, #3290, #4627, #5054, #3878, #2881, #1506, #1216, #968).
Also useful for interactive completion/selection popups (#2057, #718)
Based on @kudaba PR. Design for Inputtext V2 should make this obsolete.
2024-02-07 22:04:18 +01:00
ocornut
96839b445e Nav: Improve handling of Alt key to toggle menu so that key ownership may be claimed on indiviudal left/right alt key without intefering with the other.
See test "inputs_owner_single_mod"
2024-01-25 16:51:07 +01:00
ocornut
7194756370 Shortcut: fixed single mod-key Shortcut from working e.g. Shortcut(ImGuiKey_LeftCtrl) 2024-01-25 15:42:19 +01:00
ocornut
8491cf36ad Inputs: g.ActiveIdUsingManyKeys[] prevent routes from being claimed.
Amend fc134f5
2024-01-24 18:53:36 +01:00
ocornut
9176eedf24 Internals: SetShortcutRouting() move code so next commit is easier to read. Should be no-op. 2024-01-24 18:51:00 +01:00
ocornut
81e0be856a Fixed strict-aliasing violation in FormatTextureIDForDebugDisplay(). (#7090, #7256) 2024-01-24 14:27:43 +01:00
ocornut
a201af7354 Added SetNextItemShortcut() wip function. (#456)
Mark widget as hovered. Amend d10641b.
2024-01-22 18:38:54 +01:00
ocornut
4c2c09450a Nav: keyboard/gamepad activation feedback properly timed instead of frame buffer. (#456)
Amend d10641b
2024-01-22 18:26:45 +01:00
ocornut
763100b385 Nav: Fixed pressing Escape while in a child window with _NavFlattened flag. (#7237) 2024-01-19 18:37:21 +01:00
ocornut
c7edb446ca Shortcut(): always test ownership.
- It doesn't sense to test route without ownership (which may be overrided by code not using routing)
- It also wouldn't be possible to call Shortcut() with _None anyway, since successful routing sets ownership.
Tangential to experiments for #7237
2024-01-19 16:40:24 +01:00
ocornut
1844f903d5 Nav: space/enter poll check ownership. InputText: declare ownership of Enter key as it doesn't go through Shortcut
InputText: no need to call SetShortcutRouting() directly.
Tangential to experiments for #7237
2024-01-19 16:22:45 +01:00
ocornut
d7c2a0e38f Shortcut(): fixed 8323a06 adding _Repeat to all Shortcut() calls. 2024-01-17 18:21:04 +01:00
ocornut
3b828d3701 Refactor: moving ItemAdd() into a section abote ItemSize(). No logic change (part 2)
Diff not ideal (in Fork it looks like ItemSize is moved) but understandable at a glance.
2024-01-17 17:34:28 +01:00
ocornut
ff5f3aa38b Refactor: moving ItemAdd() into a section abote ItemSize(). No logic change (part 1)
Moved KeepAliveID() as well for increased locality.
Adding dummy ItemAdd() placeholder to facilitate diffing (otherwise single commit single diff is a mess).
2024-01-17 17:32:50 +01:00
ocornut
1a48a63446 Enclosed a few more remaining sections in ifndef IMGUI_DISABLE_DEBUG_TOOLS for completeness. 2024-01-17 15:55:36 +01:00
ocornut
5fdcdf7080 Shortcut: ImGuiInputFlags_RouteFocused policy can filter Shortcuts conflicting with character input when an item is active. (#456) 2024-01-16 17:51:14 +01:00
ocornut
80d5cb1ab1 Comments around ImGuiInputFlags. 2024-01-16 16:25:08 +01:00
ocornut
1cc0eb4d32 Internals: Rename NavFocusScopePath to NavFocusRoute + fixed a static analyzer warning. 2024-01-16 12:32:00 +01:00
ocornut
46e5f44ec8 Shortcut()/SetShortcutRouting(): use mixed current window focus scope + ParentWindowForFocusRoute. (#6798, #2637, #456)
Amend d474836
Begin: tweak clearing of CurrentWindow as FocusWindow() relies on it now.
Addded SetWindowParentWindowForFocusRoute() helper.
2024-01-16 11:39:41 +01:00
ocornut
e0c8c80ada Shortcut()/SetShortcutRouting(): focus route testing now use ParentWindowForFocusRoute. Automatically set on child-window, manually configurable otherwise. (#6798, #2637, #456) 2024-01-15 17:33:47 +01:00
ocornut
4b20a0217e Internals: add window to FocusScopeStack. (#6798) 2024-01-15 17:33:47 +01:00
ocornut
2156db7a07 Debug Log: added InputRouting logging. Made GetKeyChordName() use its own buffer. Fixed debug break in SetShortcutRouting(). (#6798, #2637, #456) 2024-01-15 17:33:23 +01:00