1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-14 11:07:48 +01:00
Commit Graph

930 Commits

Author SHA1 Message Date
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
7c3fa7d049 Refactor: moved section in imgui_internal.h 2024-01-22 17:42:00 +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
33fabdf392 Scrollbar() doesn't forcefully mark itself as hovered when held.
Weirdly as old as when dinosaurs roamed earth, aka first commit (per-1.0).
+ Minor alignment in both sense of the term :) Reduce padding in ImGuiNextItemData.
2024-01-17 15:47:14 +01:00
ocornut
095665977f Nav: marking NavId as hovered in ButtonBehavior() doesn't check for ActiveId.
Aimed at allowing activating another item with a shortcut without losing NavId.
Initial logic from c2cb2a69, with minor amends db5f1b79c, cea78cc57.
2024-01-17 14:52:05 +01:00
ocornut
d10641b04a Nav: keyboard/gamepad activation mark widgets as held to give better visual feedback. 2024-01-17 14:02:07 +01:00
ocornut
29809d7220 Version 1.90.2 WIP 2024-01-11 14:37:13 +01:00
ocornut
d6cb3c923d Version 1.90.1 2024-01-10 18:00:57 +01:00
ocornut
788bb58b6b Metrics: Tweak, reorganize tools menu. 2024-01-10 15:12:24 +01:00
ocornut
7f9533b840 ColorPicker: Fixed saturation/value cursor radius not scaling properly.
+ Misc docs/comments.
2024-01-08 16:08:12 +01:00
ocornut
7938550d52 Comments and some extra line-wrapping in demo (#3193) 2024-01-04 11:50:38 +01:00
ocornut
4a2426449a Drags, Sliders, Inputs: removed all attempts to filter non-numerical characters during text editing. (#6810, #7096) 2023-12-22 19:51:49 +01:00
ocornut
036a6c875e ColorEdit4: Further tweaks for very small sizes. (#7120, #7121) 2023-12-20 11:06:22 +01:00
ocornut
0bd6489721 DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: fixed multi-components width in tight space (#7120, #7121)
+ extra tweak color ColorEdit4() label. Amend 86512ea, 3464662
2023-12-19 20:50:17 +01:00
ocornut
e265610a0c Fixes for MSVC code analyzer. 2023-12-18 18:36:01 +01:00
ocornut
0d582dabf3 Fixed warning (amend 54c1bde) 2023-12-14 17:24:23 +01:00
ocornut
6cfe3ddf52 InputTextMultiline: Tabbing through a multi-line text editor using ImGuiInputTextFlags_AllowTabInput doesn't activate it. (#3092, #5759, #787) 2023-12-14 17:15:43 +01:00
ocornut
54c1bdeceb Internals: removed unused ImGuiItemStatusFlags_FocusedByTabbing. (#4449)
Amend 1a7526d
2023-12-14 16:45:40 +01:00
ocornut
4afffa36e9 InputTextMultiline: Fixed Tab character input not repeating
(1.89.4 regression)
2023-12-14 16:31:18 +01:00
Nahor
34646627aa
ColorEdit4: improve components width computation to better distribute the error (#7120) (#7123) 2023-12-12 11:07:01 +01:00
ocornut
9d8de45313 Image(): comment and minor refactor to resurface the fact that a border size may be added. (#2118)
Make more similar to ImageButton()
2023-12-07 16:07:50 +01:00
ocornut
c58d2c89c3 Tabs: Added ImGuiTabItemFlags_NoAssumedClosure to enable app to react on closure attempt. (#7084) 2023-12-07 14:20:35 +01:00
Johel Ernesto Guerrero Peña
1fd5ff7152 Avoid C++26 removed deprecated arithmetic conversion on enumerations. (#7088, #7089. #2983, #3040) 2023-12-05 12:13:08 +01:00
ocornut
5768de79e2 InputText, ColorEdit, ColorPicker: better support for undocumented ImGuiItemFlags_ReadOnly flag. (#7079, #211)
Amend fdc526e8f
2023-12-01 13:57:28 +01:00
ocornut
b112d73edb Menus: amend to clarify/fix static analyzer warning. (#6671, #6926) 2023-11-29 17:08:06 +01:00
ocornut
2ee40d3cf9 Menus: Tweaked hover slack logic, adding a timer to avoid situations where a slow vertical movements toward another parent BeginMenu() can keep the wrong child menu open. (#6671, #6926) 2023-11-29 16:46:21 +01:00
ocornut
bce4db00bc Drag and Drop: Fixed drop target highlight on items temporarily pushing a widened clip rect. (#7049, #4281, #3272) 2023-11-22 19:30:16 +01:00
ocornut
61b8197942 Misc: Renamed some defines in imstb_textedit.h to avoid conflicts when using unity/jumbo builds.
Bitting the bullet, as we rarely update this (and it is rarely updated) and it we may replace it anyhow.
2023-11-22 14:12:31 +01:00
ocornut
3d083dbe1a Version 1.90.1 WIP 2023-11-15 23:53:58 +01:00
ocornut
b81bd7ed98 Version 1.90.0
w/ Changelog tweaks.
2023-11-15 15:56:05 +01:00
ocornut
5de1312e1c SplitterBehavior: tweak to not assert due to floating point precision.
Not guaranting behavior: clamping makes output lossy, size_1+size_2 in theory may be instable but couldn't repro.
API probably needs rework anyhow (should redistribute from provided available space).
2023-11-14 15:34:30 +01:00
ocornut
44345c2108 Better documented the difference between BeginListBox() and BeginChild() w/ ImGuiChildFlags_FrameStyle.
BeginListBox() can't yet expose child flags because coarse clipping require query of stored size (same issue as with adding resize support to Tables).
2023-11-07 20:14:54 +01:00
ocornut
cdbc21a191 BeginChild(): Added ImGuiChildFlags_FrameStyle as a replacement for BeginChildFrame(). (#1666, #1496, #1395, #1710, #462, #503, #263)
Effectively allows us to avoid extending BeginChildFrame() api to mimic BeginChild() new parameters.
2023-11-07 18:50:32 +01:00
ocornut
7713c29258 BeginChild: Upgraded 'bool border = true' parameter to use a ImGuiChildFlags type and the ImGuiChildFlags_Border value. (toward #1666, #1496, #1395, #1710) 2023-11-02 17:26:05 +01:00
ocornut
88fec09715 ColorPicker4(): Fixed ImGuiColorEditFlags_NoTooltip when ImGuiColorEditFlags_NoSidePreview is also set. (#6957) 2023-10-26 15:45:45 +02:00
ocornut
feddcf3030 Combo: amends for ImGuiComboFlags_WidthFitPreview. (#6881)
Amend 112d8fc
2023-10-09 11:34:05 +02:00
mpv-enjoyer
112d8fc41d Combo: added ImGuiComboFlags_WidthFitPreview. (#6881) 2023-10-09 11:26:00 +02:00
ocornut
0312a29e4c ImageButton(): clarify purpose of size. (#6901, #5533, #4471, #2464, #1390).
Amend 4a2ae06ca
2023-10-05 18:51:45 +02:00
ocornut
2c07d581de TreeNode: Added ImGuiTreeNodeFlags_SpanAllColumns for use in tables. (#3151, #3565, #2451, #2438) 2023-10-05 15:05:58 +02:00
ocornut
28b237f94d Separator(): Altered end-points to use more standard boundaries. (#205, #4787, #1643, #759) 2023-10-03 15:26:35 +02:00
ocornut
330d763477 Separator: clarified setting the ImGuiSeparatorFlags_SpanAllColumns flag. (#759)
Technically a no-op.
2023-10-03 15:24:42 +02:00
ocornut
456aa3bc0a Menus: Fixed a bug where activating an item in a child-menu and dragging mouse over the parent-menu would erroneously close the child-menu. (#6869)
Regression from 0dec430
2023-09-27 16:34:31 +02:00
ocornut
94da5842ef Renamed ImFloor() to ImTrunc(). Renamed ImFloorSigned() to ImFloor(). (#6861) 2023-09-26 11:18:29 +02:00
ocornut
e5ca5351d5 TabBar: Fixed position of unsaved document marker (ImGuiTabItemFlags_UnsavedDocument) which was accidentally offset in 1.89.9. (#6862)
Amend 4a814244
2023-09-25 20:40:01 +02:00
ocornut
ef8ff1b5d8 TabBar, Style: added style.TabBarBorderSize and associated ImGuiStyleVar_TabBarBorderSize. (#6820, #4859, #5022, #5239)
Cherry-picked from docking's 64b1e44
2023-09-18 15:29:42 +02:00
ocornut
b101cf46b6 ListBox, Combo: Changed signature of "name getter" callback in old one-liner ListBox()/Combo() apis. 2023-09-15 18:43:04 +02:00
ocornut
8a2cd81091 TypingSelect: always enable nav highlight.
Otherwise in non multi-select contexts as nav dosn't automatically select result would not always be visible.
2023-09-15 16:58:06 +02:00
ocornut
223b19f116 Fixed warning when builidng with IMGUI_DISABLE_DEBUG_TOOLS. 2023-09-14 18:37:30 +02:00
ocornut
779568bb38 TypingSelect: tidy up some more + split ino functions to make reuse simpler. 2023-09-14 18:36:21 +02:00
ocornut
661a70fc79 TypingSelect: fast switch between characters in + debug, internal renames.
# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2023-09-14 17:45:54 +02:00
ocornut
c86ce70968 Internal: Nav,MultiSelect: import ImGuiSelectionUserData, SetNextItemSelectionUserData() from MultiSelect. Track NavLastValidSelectionUserData as a convenience. 2023-09-12 20:29:36 +02:00
ocornut
f336e639e9 TypingSelect: rework GetTypingSelectRequest(), provide TypingSelectFindResult().
Amend 9714594
2023-09-12 16:36:54 +02:00
ocornut
0e1ce76ea8 InputTextMultiline: Fixed Tabbing cycle leading to a situation where Enter key wouldn't be accepted by the widget when navigation highlight is visible. (#6802, #3092, #5759, #787)
+ Added test in ImGuiTestSuite: "widgets_inputtext_multiline_enter"
2023-09-11 11:41:56 +02:00
ocornut
0962c9fb72 TypingSelect: Added first version of GetTypingSelectRequest() API.
# Conflicts:
#	imgui_internal.h
#	imgui_widgets.cpp
2023-09-08 17:20:03 +02:00
ocornut
fa2e5710ac MenuBar: Fixed an issue where layouting an item in the menu-bar would erroneously egister contents size. (#6789)
In dire need of removing BeginGroup()/EndGroup() from menu-bar code, fo r sanity.
2023-09-06 15:35:03 +02:00
ocornut
d8ef864b02 InputTextMultiline: Fixed a crash pressing Down on last empty line of a multiline buffer. (#6783, #6000)
Amend 57a5b73a4c
2023-09-06 11:28:14 +02:00
ocornut
cf1c4a0cb1 BeginListBox(): fixed not consuming SetNextWindowXXX data when returning false. 2023-09-05 16:47:00 +02:00
ocornut
fef3389157 Version 1.89.9 2023-09-04 14:30:32 +02:00
ocornut
3816d478df ImDrawList: small debug-mode optimization when calling AddRect() without rounding + Selectable: small debug-mode optimization.
# Conflicts:
#	imgui_widgets.cpp
2023-09-01 15:25:47 +02:00
ocornut
f93d0befaf Slider: fixed support for ImGuiItemFlags_ReadOnly/ImGuiSliderFlags_ReadOnly although it is technically unused/undocumented. (#6758)
Amend fdc526e8f
2023-08-29 12:19:15 +02:00
ocornut
33ea1e8b78 ColorEdit, ColorPicker: Manipulating options popup don't mark item as edited. (#6722) 2023-08-28 10:38:13 +02:00
ocornut
4a81424492 CloseButton, CollapseButton: don't include FramePadding into size. Use ItemInnerSpacing.x between title bar buttons. (#6749) 2023-08-25 14:14:34 +02:00
ocornut
b41811a68c CollapseButton: handle clipping better + align circle like in docking branch.
Amend 6c3697f6
2023-08-25 14:11:33 +02:00
ocornut
ba1fa904a9 IO: Exposed io.PlatformLocaleDecimalPoint to configure decimal point ('.' or ','). (#6719, #2278)
Amend 13f718337
2023-08-17 13:12:21 +02:00
ocornut
a1a7a1bc03 InputFloat, SliderFloat, DragFloat: always turn both '.' and ',' into the current decimal point character. (#6719, #2278) 2023-08-17 13:02:56 +02:00
ocornut
bc3c0ce772 Nav, TreeNode: Pressing Left with ImGuiTreeNodeFlags_NavLeftJumpsBackHere now goes through proper navigation logic: honor scrolling and selection. (#1079, #1131)
Added a stack for this purpose which other features might build on (e.g. #2920). However this is currently gated by many tests and not a performance concern, but making stack happen all the time may be undesirable.
2023-08-08 14:07:00 +02:00
Johannes Barthelmes
b7a7d673b9 Fixed an integer overflow and div-by-zero in SliderInt() when v_max is INT_MAX (#6675, #6679) 2023-08-03 20:13:31 +02:00
ocornut
d6d94d90bf Version 1.89.9 WIP
+ Minor typo fixes
2023-08-03 19:19:21 +02:00
ocornut
f7eea63872 Version v1.89.8 2023-08-01 12:53:57 +02:00
ocornut
79d6f4e211 Misc: Avoid stb_textedit.h reincluding string.h while in a namespace. (#6653, #4791) 2023-07-27 19:45:28 +02:00
ocornut
0e8eb8c48e Removed _MSC_VER <= 1500 checks for Visual Studio 2008 or earlier.
Our codebase requires VS2012+ since a while.
2023-07-13 12:38:16 +02:00
ocornut
b7cdb5a31e Scrollbar: layout needs to take account of window border size, so a border size will slightly reduce scrollbar size. (#2522)
Rework/revert intent of c1a61d25a.
2023-07-11 15:01:25 +02:00
ocornut
b32ef809c3 InputText: Fixed a case where deactivation frame would write to underlying buffer or call CallbackResize although unnecessary, in a frame where the return value was false. 2023-07-06 19:32:28 +02:00
ocornut
3349296370 InputText: Tweak ImGuiInputTextFlags_EscapeClearsAll handling so decision is taken on input buffer + Showcase a few more InputText() flags. (#5688, #2620)
This makes is more obvious that value_change==true when apply_new_text != NULL.
2023-07-06 19:32:01 +02:00
ocornut
3fe4319314 Version 1.89.8 WIP 2023-07-05 14:17:46 +02:00
ocornut
d4ddc46e77 InputText: Fixed a crash on deactivating a ReadOnly buffer. (#6570, #6292, #4714)
This will be part of 1.89.7 Tagged relase.
2023-07-04 16:20:51 +02:00
ocornut
cb9015e254 Version 1.89.7 2023-07-04 14:56:09 +02:00
ocornut
64172685d6 InputText: ImGuiInputTextCallbackData::InsertChars() accept (NULL,NULL) range, in order to conform to common idioms. (#6565, #6566, #3615) 2023-07-03 11:58:17 +02:00
ocornut
a02315e1c4 Combo: Made simple/legacy Combo() function not returns true when picking already selected item. (#1182) 2023-06-28 15:47:10 +02:00
ocornut
6137443d24 Overlap: moved ImGuiItemflags_AllowOverlap handling from ButtoBehavior() to ItemHoverable() now that it is possible. (#6512, #3909, #517)
This allows DragXXX, SliderXXX, PlotXXX etc to honor SetNextItemAllowOverlap().
2023-06-28 14:42:14 +02:00
ocornut
4dee919bc0 (Breaking) Internals: added ImGuiItemFlags param to ItemHoverable(), so it can be called from ButtonBehavior() not following an ItemAdd().
This also allow moving AllowOverlap logic from ButtonBehavior() to ItemHoverable(), allowing other widgets to honor it. (#6512, #3909, #517)
2023-06-28 14:42:14 +02:00
ocornut
8439a73645 Overlap: Added 'SetNextItemAllowOverlap()' as a replacement for 'SetItemAllowOverlap()'. (#6512, #3909, #517)
# Conflicts:
#	imgui.cpp
#	imgui_widgets.cpp
2023-06-28 14:40:47 +02:00
ocornut
a9a5cbf431 Overlap: Internals: add NextItemData.ItemFlags to facilitate implementation of SetNextItemAllowOverlap() + potentially remove extra_flags from ItemAdd(). (#6512, #3909) 2023-06-28 14:40:47 +02:00
ocornut
07e24b4058 ButtonBehavior: pull ImGuiButtonFlags_Repeat from ImGuiItemFlags_ButtonRepeat, matching ItemHoverable() logic. So more widgets can take advantage of Repeat logic. 2023-06-28 14:40:47 +02:00
ocornut
51f564eea6 (Breaking) Overlap: Renamed 'ImGuiTreeNodeFlags_AllowItemOverlap' to 'ImGuiTreeNodeFlags_AllowOverlap', 'ImGuiSelectableFlags_AllowItemOverlap' to 'ImGuiSelectableFlags_AllowOverlap'. Kept redirecting enums (will obsolete). (#6512, #3909, #517)
+ Internals: Renamed 'ImGuiButtonFlags_AllowItemOverlap' to 'ImGuiButtonFlags_AllowOverlap' without redirection.
2023-06-28 14:37:05 +02:00
ocornut
06f5b46133 Overlap: Fixed first frame of an overlap highlighting underlying item if previous frame didn't hover anything. (#6512, #3909, #517) 2023-06-27 15:46:35 +02:00
ocornut
d5d4d709c7 Drag and Drop: moved "drag souce doesn't report as hovered" from ButtonBehavior() to ItemHoverable().
Ensure DragXXX, SliderXXXX, InputText, PlotXXX follow same logic. Amend 251f178a6, a33f0d1f7
2023-06-27 14:44:39 +02:00
ocornut
a2f6581171 Selectable: Fixed bad manual cherry-pick/merge (fixes 3ec128c) 2023-06-27 10:57:08 +02:00
ocornut
3ec128c5fd Selectable, TreeNode: When using ImGuiSelectableFlags_AllowOverlap/ImGuiTreeNodeFlags_AllowOverlap and holding item held, overlapping widgets won't appear as hovered. (#6512, #3909)
Essentially we are going to remove calls to SetItemAllowOverlap() and standardize the fact that only 'HoveredId == id' test from it is performed.

# Conflicts:
#	imgui_widgets.cpp
2023-06-26 19:08:10 +02:00
ocornut
0a53b45858 CollapsingHeader/TreeNode: Fixed text padding when using _Framed+_Leaf flags. (#6549) 2023-06-26 11:15:55 +02:00
ocornut
94c46d7486 InputText: Fixed not returning true when buffer is cleared by ImGuiInputTextFlags_EscapeClearsAll. (#5688, #2620) 2023-06-21 14:20:13 +02:00
Krzysztof Adamek
959a9c79bd TreeNode: Added support for ImGuiTreeNodeFlags_UpsideDownArrow in frameless tree nodes (#6517, #6538) 2023-06-20 15:30:40 +02:00
ocornut
b60acfa87d Tooltips: Added SetItemTooltip(), BeginItemTooltip(). Improved Demo section. 2023-06-20 15:04:14 +02:00
ocornut
d96bbf0aae TreeNode: Added undocumented ImGuiTreeNodeFlags_UpsideDownArrow flag. (#6517)
+ Minor tweak comment/layout in ImGuiIO
2023-06-19 14:33:23 +02:00
ocornut
15d74bad1d Internals: Tooltips: renamed internal flags (expecting to expose later when we publish priority stuff). 2023-06-16 16:55:51 +02:00
ocornut
a134892a3d BeginComboPreview: fix when part of preview rect is clipped by parent window. (#6501, #1658) 2023-06-09 13:41:11 +02:00
ocornut
61ebb37843 Version 1.89.7 WIP 2023-06-01 11:22:43 +02:00
ocornut
5319d1cffa Version 1.89.6 2023-05-31 14:47:32 +02:00
ocornut
45c8c3b611 Listbox: commented out obsolete/redirecting functions that were marked obsolete more than two years ago: ListBoxHeader(), ListBoxFooter().
+ Added default parameter to SeparatorEx() amend 2c558d5
2023-05-22 10:09:20 +02:00