1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-12 02:00:58 +01:00
Commit Graph

4078 Commits

Author SHA1 Message Date
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
f6bd7c8e53 Debug Tools: Item Picker: remove IMGUI_DEBUG_TOOL_ITEM_PICKER_EX since it doesn't work on non-ItemHoverable() items anyway. (#2673)
Call stack difference not meaningful.
2022-10-21 18:32:40 +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
5ac94ad898 Window: Fixed an issue where uncollapsed a window would show a scrollbar for a frame.
Amend / fix regression from 6e8e2c0
2022-10-18 16:43:38 +02:00
ocornut
08752b372e Menus, Popups: Experimental fix for issue where clicking on an open BeginMenu() item called from a window which is neither a popup neither a menu used to incorrectly close and reopen the menu. (#5775)
This works by moving the ClosePopupsOverWindow() in FocusWindow() in the if() block which luckily solves our problem.
In our test suite I couldn't find situation where this had side-effect others than BeginMenu() using the 'menuset_is_open' trick.
It's difficult to tell if other side-effects are possible: a window being already focused should mean it doesn't have popups overit.
Effectively this means that clicking e.g. on the BeginMenu() item to close a menu in a menu-bar now relies on BeginMenu() logic for the closure rather than FocusWindow() triggerd by button behavior.
2022-10-14 18:47:00 +02:00
ocornut
81176737f8 Menus: Fixed using IsItemHovered()/IsItemClicked() on BeginMenu(). (#5775) 2022-10-14 17:39:04 +02:00
ocornut
3e8d198133 Removed runtime patching of obsolete/invalid "%f"/"%.0f" types of format strings for DragInt()/SliderInt(). 2022-10-12 23:09:09 +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
c7d3d22ae1 Scrolling: Mitigated issue where multi-axis mouse-wheel inputs (usually from touch pad events) are incorrectly locking scrolling in a parent window. (#4559, #3795, #2604) 2022-10-04 15:41:57 +02:00
ocornut
80a870a3e5 Scrolling: Tweak mouse-wheel locked window timer so it is shorter but also gets reset whenever scrolling again (#2604) + small refactor
Somehow interesting for (#3795, #4559). sorry this will break PR for 3795 but we got the info.
2022-10-04 15:34:17 +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
cc5058e5d7 IO: Filter duplicate input events during the AddXXX() calls. (#5599, #4921) 2022-09-29 22:01:11 +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
9e7f460c09 Fixed GetKeyName() for ImGuiMod_XXX values, made invalid MousePos display in log nicer. (#4921, #456)
Amend fd408c9
2022-09-29 22:00:35 +02:00
ocornut
9f6aae3bf2 Nav: Fixed race condition pressing Esc during popup opening frame causing crash. 2022-09-29 19:48:27 +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
a725db17b7 Comments for flags discoverability + add to debug log (#3795, #4559) 2022-09-27 20:08:40 +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
1dd964f87d Popups & Modals: Fix (amended) somehow undocumented Popup+Child behavior (useful for e.g. #718, #4461 and probably other things)
(broken by 1c4066cd)
2022-09-16 23:27:16 +02:00
ocornut
440f257688 Popups & Modals: fixed nested Begin() being erroneously input-inhibited. (useful for e.g. #718, #4461 and probably other things) 2022-09-16 22:08:11 +02:00
tocic
2b1d8e3eaf Fix more typos in sources and docs (#5681) 2022-09-14 20:36:45 +02:00
tocic
6c3c9cea7f Fix typos in source comments (#5675) 2022-09-13 11:09:34 +02:00
ocornut
513c1ba996 Removed the bizarre legacy default argument for 'TreePush(const void* ptr = NULL)' (#1057)
Followup to e605f2179
2022-09-12 16:00:19 +02:00
ocornut
52d9ee0dc2 Tabs: Fixed ShrinkWidths() redistribution of remainder leading to infinite bug (second fix). (#5652, #5262)
Amend b137f31
2022-09-09 20:01:59 +02:00
ocornut
9e1ccf8fab Commented out redirecting functions/enums names that were marked obsolete in 1.77 and 1.78 (June 2020): (#3361)
- DragScalar(), DragScalarN(), DragFloat(), DragFloat2(), DragFloat3(), DragFloat4() with signature ending with (..., float power = 1.0f)
- SliderScalar(), SliderScalarN(), SliderFloat(), SliderFloat2(), SliderFloat3(), SliderFloat4() with signatures ending with (..., float power = 1.0f)
- BeginPopupContextWindow(const char*, ImGuiMouseButton, bool)
2022-09-05 14:38:00 +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
7f25143972 Better error reporting for PopStyleColor()/PopStyleVar() + easier to recover. (#1651) 2022-09-01 10:54:00 +02:00
ocornut
747c9a7adf IsKeyPressed(), IsMouseClicked(), GetKeyPressedAmount(): add a (normally unnecessary) test for ->Down next to ->DownDuration tests, facilitating the use of key eating mechanism.
Consider removing when we add support for input ownership.
2022-08-31 19:15:13 +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
b3b3a07133 Nav: Fixed regression in e99c4fc preventing CTR+Tab to work without NavEnableKeyboard (#5504, #4023); 2022-08-24 14:45:11 +02:00
ocornut
72096bf698 Clipper: simplify code and remove cases where true is returned with empty display range as an extra step. 2022-08-23 15:40:07 +02:00
ocornut
07b9999de9 Debug Log: added 'Clipper' events logging. 2022-08-23 15:40:07 +02:00
ocornut
4eb9066997 Clipper: extract code into a ImGuiListClipper_StepInternal() to facilitate debugging. Moved clipper End() call to outer layer, stopped heretic use of comma operator.
Removed obsolete comments in clipper Begin()
2022-08-23 15:40:06 +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
5b0510c5b7 TestEngine: facilitate aiming at InputScalar() using wildcards + removed unnecessary IDStack.size hack (require TestEngine latest) 2022-08-20 22:55:51 +02:00
ocornut
a396233cb6 Platform IME: Windows: Revert 133bbafa and 29a8ee08 as regression until new results comes. (#2589, #5535, #5264, #4972) 2022-08-08 12:42:57 +02:00
ocornut
839c31006b Debug Log: Added IO events logging. 2022-08-08 11:58:57 +02:00
ocornut
133bbafa3c Platform IME: Windows: Fixed a call to ImmAssociateContextEx() leading to freeze on some setups. (#2589, #5535, #5264, #4972)
+ misc comments
2022-08-08 11:31:48 +02:00
Vlad Serebrennikov
c911901b5e
Fix ImGuiIO docs and default values (#5540) 2022-08-03 22:46:31 +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
Rokas Kupstys
0e95cf0dec Fix appending to windows causing a child window to be inserted to g.WindowsFocusOrder which eventually causes a crash. (#5515, #3496, #4797)
Amend a528398
2022-08-03 14:44:05 +02:00
ocornut
e99c4fc668 Nav: fixes keyboard/gamepad nav actions running without the corresponding config flags (#5504). Fixes 8b8a61b. #4921, #4858, #787, #1599, #323)
NavUpdate() can now clears ImGuiInputSource_None.
2022-07-25 17:19:45 +02:00