Commit Graph

1393 Commits

Author SHA1 Message Date
ocornut
529cba19b0 Debug Tools: Added DebugLocateItem()/DebugLocateItemOnHover() to visually locate items when hovering a 0xXXXXXXXX value. (#5855, #2673, #4631) 2022-11-04 16:06:34 +01:00
ocornut
7109f32f96 Internals: tidying up and stripping more of focus scope code. 2022-11-04 12:19:23 +01:00
ocornut
9f66a3a9ed Internals: rework FocusScope system, current scope doesn't need to be in window + child doesn't inherit.
Intended as part of work for input routing + blind menu processing shortcuts. Some of this commit will be stripped by next commit.
Intent was to sort windows along with focus scope to build a hierarchy, but for our needs we'd need a persistant one, so scrapping the idea. Not squashing this with next commit to keep a bit of history for future references.
2022-11-04 12:19:20 +01:00
ocornut
baea25e657 Drag and Drop: extracted a RenderDragDropTargetRect() function (#1603) 2022-10-25 15:54:22 +02:00
ocornut
431fc6a7f6 Internals: using ItemAdd() consistently for internal items: windows & tables resize grips/borders, ScrollbarEx().
This put an extra flag check in ItemAdd() but essentially reduce inconsistency with windows decorations not using this. Useful for debugging.
It however buries the info/blurs the line about what it means to not use ItemAdd() since they are now doing it much less.
2022-10-24 22:54:29 +02:00
ocornut
178aee4b1c Debug Tools: Debug Log: add and use ImGuiTextLineIndex.
This is needed for next commit where we want to parse hovered Debug Log line.
2022-10-24 21:23:59 +02:00
ocornut
bc918404fe Internals: using ImToUpper() since std one does too many things.
As a bonus side-effect may remove reliance on ctype.h (will see if CI complains)
2022-10-21 16:13:52 +02:00
ocornut
9a35bfea39 Internals: added temporary ImGuiItemStatusFlags_Visible (used internally - please do not use).
Used by BeginMenu() as I'm experimenting with blind menus honoring shortcuts.
Extra comments about KeyMap and ImGuiKeys
2022-10-21 14:57:10 +02:00
ocornut
8a44c31c95 Scrolling: Further reduce unrelease mouse-wheel locked window timer + misc refactor (#2604, #3795, #4559)
The refactor are designed to minimize the diff for changes needed for #3795
2022-10-06 20:17:28 +02:00
ocornut
85a368b58d Fixed ImGuiWindowFlags_UnsavedDocument clipping label in docked windows with no close button. (#5745)
+ TabBar: starts displaying the unsaved document marker with a frame delay to match how close button is processed, otherwise the transition would be noticeable.
2022-10-04 18:03:56 +02:00
ocornut
f2a522d70d ImDrawList: Not using alloca() anymore, lift single polygon size limits. (#5704, #1811) 2022-09-30 15:58:55 +02:00
ocornut
fac8295d6e IO: remove ImGuiInputEvent::IgnoredAsSame (revert part of 839c3100), will filter earlier in next commit. (#5599)
Making it a separate commit as this leads to much indentation change.
2022-09-29 22:00:38 +02:00
ocornut
bd2355a047 Menus, Nav: Fixed using left/right navigation when appending to an existing menu (multiple BeginMenu() call with same names). (#1207) 2022-09-29 19:25:26 +02:00
ocornut
3532ed1621 Menus, Nav: Fixed keyboard/gamepad navigation occasionally erroneously landing on menu-item in parent when the parent is not a popup. (#5730)
Replace BeginMenu/MenuItem swapping g.NavWindow with a more adequate ImGuiItemFlags_NoWindowHoverableCheck.
Expecting more subtle issues to stem from this.
Note that NoWindowHoverableCheck is not supported by IsItemHovered() but then IsItemHovered() on BeginMenu() never worked: fix should be easy in BeginMenu() + add test is IsItemHovered(), will do later
2022-09-29 18:44:19 +02:00
ocornut
d5d705069d Various comments
As it turns out, functions like IsItemHovered() won't work on an open BeginMenu() because LastItemData is overriden by BeginPopup(). Probably an easy fix.
2022-09-29 18:44:19 +02:00
ocornut
d17627b9c6 InputText: leave state->Flags uncleared for the purpose of backends emitting an on-screen keyboard for passwords. (#5724) 2022-09-28 17:38:41 +02:00
ocornut
e0330c1696 Fonts, Text: Fixed wrapped-text not doing a fast-forward on lines above the clipping region. (#5720)
which would result in an abnormal number of vertices created.
2022-09-28 14:58:41 +02:00
ocornut
c261dac02f Demo: moved ShowUserGuide() lower in the file, to make main demo entry point more visible + fix using IMGUI_DEBUG_LOG() macros in if/else. 2022-09-26 14:56:36 +02:00
ocornut
fd408c9790 Renamed and merged keyboard modifiers key enums and flags into a same set:. ImGuiKey_ModXXX -> ImGuiMod_XXX and ImGuiModFlags_XXX -> ImGuiMod_XXX. (#4921, #456)
Changed signature of GetKeyChordName() to use ImGuiKeyChord.
Additionally SetActiveIdUsingAllKeyboardKeys() doesn't set ImGuiKey_ModXXX but we never need/use those and the system will be changed in upcoming commits.
2022-09-26 10:43:26 +02:00
ocornut
f359dca0dc Misc input related changes to facilitate upcoming merges. 2022-09-22 19:00:30 +02:00
ocornut
4b522e145c Experiment: ImGuiKey is now a typed enum, allowing ImGuiKey_XXX symbols to be named in debuggers. (#4921, #4537)
May affect binding generators.
2022-09-20 12:42:29 +02:00
ocornut
cb48c81a44 Tabs: Fix initial tab state. Amend 3e6f948( (#5572)
Somehow this only triggers a failing test in docking branch.
2022-09-09 20:47:27 +02:00
ocornut
edcd5b113e Obsoleted using SetCursorPos()/SetCursorScreenPos() to extend parent window/cell boundaries. (#5548)
This incorrect pattern has been mentioned or suggested in: #4510, #3355, #1760, #1490, #4152, #150
2022-09-02 16:37:35 +02:00
Rokas Kupstys
b3ea01d86f Menus: Fix sub-menu inhibition stopping working in some cases. (Amend WIP) (#2517, #5614, noticed in #5546)
Amend bda2cde6
Fixes the case where following menu hover sequence results in incorrect RestoreNavWindow (previously SourceWindow) pointing to opened sub-menu:
1. Hover "Menu -> Options" - Open ##Menu_01 window
2. Hover "Menu -> Colors"  - SourceWindow incorrectly points to ##Menu_01 window
2022-09-01 17:02:46 +02:00
ocornut
e13913ed57 IsItemHovered: Added ImGuiHoveredFlags_DelayNormal, ImGuiHoveredFlags_DelayShort, ImGuiHoveredFlags_NoSharedDelay. (#1485)
IsItemHovered() can't have a non-zero default, but higher-level tooltip helpers may enable a different default later.
2022-08-24 21:32:13 +02:00
ocornut
07b9999de9 Debug Log: added 'Clipper' events logging. 2022-08-23 15:40:07 +02:00
ocornut
d357e8504b TestEngine: revert part of 5b0510c as IMGUI_TEST_ENGINE_ITEM_ADD() woul see an erreneous hierarchy.
+ Fix typo (#5600)
2022-08-22 14:36:32 +02:00
ocornut
ef6ba0d846 Misc: allowing override of IM_TABSIZE (#5593) 2022-08-20 19:54:57 +02:00
ocornut
839c31006b Debug Log: Added IO events logging. 2022-08-08 11:58:57 +02:00
ocornut
0a4ddd7246 Fix being unable to mouse wheel while dragging a payload (fix 1480bc5, #4921, #2891) 2022-08-03 22:02:00 +02:00
ocornut
4a2ae06ca4 Changed signature of ImageButton() function: Added 'const char* str_id' parameter + removed 'int frame_padding = -1' parameter. (#5533, #4471, #2464, #1390).
Also removed frame_padding parameter from ImageButtonEx(), amend e0ec69d8.
2022-08-03 21:04:33 +02:00
ocornut
2d38bc99b3 Internals: renamed recently added ImGuiInputReadFlags to ImGuiInputFlags. (Amend 8b8a61b) 2022-07-22 17:05:34 +02:00
ocornut
1480bc5d4e Added ImGuiKey_MouseXXX aliases. (#4921) Reworked SetItemUsingMouseWheel() to use this for ActiveId. (#2891)
The rework of SetItemUsingMouseWheel() is half-complete since there's a HoveredIdUsingMouseWheel component. This will however be totally cleaned when we transtion to InputOwner system.
2022-07-08 18:32:25 +02:00
ocornut
105bb3ef8a Legacy: clear g.ActiveIdUsingNavInputMask when active id is clear + Internals: added helpers GetKeyChordName(), ImGuiModFlags_All.
Amend 8b8a61b
2022-07-08 17:51:46 +02:00
ocornut
8b8a61bdf9 Removed io.NavInputs[] and ImGuiNavInput enum. Kept inline redirection code. (#4921, #4858, #787, #1599, #323) 2022-07-08 16:02:07 +02:00
ocornut
a7a25ee19d Tools: Item Picker: Mouse button can be changed by holding Ctrl+Shift. (#2673) 2022-07-07 14:18:08 +02:00
ocornut
4711b9b05a Add trailing commas to enum (to simplify the diff/patch of further additions) (#4537)
Possible since we are now C++11 + fix warning in GetNavInputAmount().
2022-07-06 20:39:39 +02:00
ocornut
90ef327882 Reordered keys representing directions to follow a consistent L/R/U/D order everywhere. (#2625, #4921, #3724)
Amended to avoid static analysis false positive.
2022-07-06 17:48:01 +02:00
ocornut
f9ccdba352 Nav: Fix regression 93f02ee + Internals: Remove ImGuiNavReadMode_Pressed, ImGuiNavReadMode_Released.
Toward using keys.
2022-07-06 17:03:50 +02:00
ocornut
93f02ee0c6 Nav: Fixed moving window with gamepad or keyboard when running at very high framerate + removed ImGuiNavDirSourceFlags_RawKeyboard. 2022-07-06 16:46:57 +02:00
ocornut
0b2da67912 Internals: clarified that GetInputTextState(0) can not return a pointer. Replaced a use of __APPLE__ with io.ConfigMacOSXBehaviors. 2022-07-05 14:40:09 +02:00
ocornut
467a1cd4a5 Misc: io.Framerate moving average now converge in 60 frames instead of 120. (#5236, #4138) 2022-07-01 17:09:58 +02:00
ocornut
0afc6cd310 Internals: InputTextEx() renames for correctness. enter_pressed -> validated, is_validate_enter -> is_enter_pressed 2022-06-30 15:31:42 +02:00
ocornut
873e9d35ac Internals: renamed TreeNodeBehaviorIsOpen() to TreeNodeUpdateNextOpen(). Added internal TreeNodeSetOpen(id). (#5423) 2022-06-28 16:11:31 +02:00
ocornut
24dfe6db8a Version 1.89 WIP 2022-06-27 16:55:55 +02:00
ocornut
088ddef98a Tables: extracted some code into TableBeginContextMenuPopup() for easier reuse for appending into context menu. 2022-06-27 16:51:08 +02:00
ocornut
9aae45eb4a Version 1.88
(fix "Show Debug Log" checkbox in Metrics window)
2022-06-21 18:11:50 +02:00
ocornut
c4b9101759 TabBar: Tweak shrinking policy so that while resizing tabs that don't need shrinking keep their initial width more precisely.
Has been the case before but adding support for SetNextItemWidth() #5262 made this more noticeable.
2022-06-21 17:13:13 +02:00
ocornut
4b97296148 TabBar: TabItem() now reacts to SetNextItemWidth() and SetNextItemOpen(true). (#5262) 2022-06-21 17:13:12 +02:00
ocornut
d3fd2630b7 Sliders: An initial click within the knob/grab doesn't shift its position. (#1946, #5328) + Adjust default GrabMinSize. 2022-06-20 18:13:10 +02:00