Commit Graph

1458 Commits

Author SHA1 Message Date
ocornut
f67b4b2225 ImStrv: detect and fixed misuses of CalcTextSize() old signature. (9321) 2026-07-03 17:10:11 +02:00
ocornut
77e1a0c97c ImStrv: made length() returns an int as it simplify the most common case (of passing %.*s to printf) 2026-07-03 17:10:11 +02:00
ocornut
c75472080f ImStrv: Combo(), ListBox(): seems better to not introduce the ImStrv [] versions?
As 1) user is unlikely to store that on their end. 2) nowadays with lambdas isn't an easy user-side conversion.
Then we limit explosion of an already messy API.
2026-07-03 17:10:10 +02:00
ocornut
b7a824fc1a ImStrv: convert Combo()/ListBox() to use ImStrv in their getters.
Didn't convert Combo() "const char* items_separated_by_zeros" as this doesn't translate well when used via a ImStrv constructor, may actually aim to obsolete.
Fixed for shadowing local variable warning on 2025/06/25.
2026-07-03 17:10:10 +02:00
ocornut
fc931b012e ImStrv: backtracked for now on supporting ImStrv for format strings.
It's widely incomplete and slow, requires a printf function taking non-zero-terminated format string to work.
Might do it eventually but it's much less a problem than labels. Format string are more frequently inlined in code and tend to be small, so existing solutions at call site can work better for now.
2026-07-03 17:10:10 +02:00
ocornut
9f56c53b7a ImStrv: standardized code doing format copy, optimized ImStrStr 2026-07-03 17:10:09 +02:00
ocornut
0829ffe82b ImStrv: moved double char* function signatures under #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS blocks + fixed various compiles errors/warnings. 2026-07-03 17:10:09 +02:00
ocornut
5d63ffc596 ImStrv: changed ImStrv xxx=NULL args to an explicit xxx=ImStrv()
This is mostly for the benefit of cimgui parser, ideally we would do without.
2026-07-03 17:10:09 +02:00
ocornut
5414b312c0 ImStrv: Step 2 - change ImStrv typedef to struct, perform all other logic conversion.
Squashed commits (initially a commit from rokups + many rework by ocornut. keeping them separate commits made rebasing unnecessarily tricking so merged from 2024/02)
ImStrv: many fixes (see details), added imconfig class extension example, added natvis description.
ImStrv: rework toward ensuring End is always set to constant can be compile time calculated
ImStrv: using length(), fix ambiguous empty() function, fix altered behaviors, removed unused operators.
ImStrv: various tweaks and fixes. removed ImGuiTextRange from ImGuiTextFilter, fix test engine hooks, removed constructor only used twice.
2026-07-03 17:10:08 +02:00
Rokas Kupstys
f15ef9c27f ImStrv: Step 1 - change string type to ImStrv in API. (REBASED)
(last rebase amend 2024/12/11)
2026-07-03 17:10:08 +02:00
ocornut
0edad6d097 Internals: track WasSelected/WasSoleSelected data for ActiveId. (#8337) 2026-07-01 18:53:27 +02:00
ocornut
e408733ecc BeginMenu(), MenuItem() use NextItemData.Flags + Fixed typo in comment. (#9456) 2026-07-01 12:38:32 +02:00
ocornut
60fbdbb8d8 Multi-Select: reworked ImGuiMultiSelectFlags_NoAutoSelect as it carried side-effects that were hardcoded/designed to use multi-selection on checkboxes. (#9391) 2026-06-25 14:13:13 +02:00
ocornut
ac6f9683b5 Style: added MenuItemRounding, SelectableRounding, ImGuiStyleVar_MenuItemRounding, ImGuiStyleVar_SelectableRounding. (#7589, #9375, #9453) 2026-06-25 11:43:50 +02:00
ocornut
0e355af09e RenderNavCursor: take rounding as input. Removed ImGuiNavRenderCursorFlags_NoRounding.
Toward #7589
2026-06-24 18:34:30 +02:00
ocornut
be374fa598 TreeNode: fixed nav cursor rendering with rounding even though tree nodes don't have it. (#7589) 2026-06-24 17:32:36 +02:00
ocornut
13fc81fc82 Tables: fixes incorrect forward declaration for a missing function + fixed tooltip comment. (#9445, #9448) 2026-06-17 12:53:36 +02:00
ocornut
e5ff2d07d7 Tables: Context-menu: added "Reset" sub-menu and "Reset Visibility" option. 2026-06-11 19:15:55 +02:00
ocornut
f241419b78 Tabs: use AddRectFilled(). 2026-06-01 16:49:18 +02:00
ocornut
12b7977555 Tweak CalcTextSize() awkward width rounding/ceiling code to reduce floating-point imprecisions altering the result by 1 even at relatively small width. (#791) + apply same fudge factor to less important roundings.
ceilf() is still measurable e.g. ballpark +0.5 for 200k calls.
2026-05-28 19:19:11 +02:00
ocornut
24a80f74a4 InputText, Style: added InputTextCursorSize to configure cursor/caret thickness. (#7031, #9409) 2026-05-22 19:12:36 +02:00
ocornut
904b663184 Clarify support for "%s" shortcuts in functions taking format strings. (#9404, #3466, #6846) 2026-05-19 18:50:39 +02:00
ocornut
c7767926ce Version 1.92.9 WIP 2026-05-15 13:28:32 +02:00
ocornut
8936b58fe2 Version 1.92.8
Include minor bits: adjust activeid logging, tweak comments.
2026-05-12 16:30:30 +02:00
ocornut
821a396556 Fixed warning on Clang 26. 2026-05-11 15:59:42 +02:00
ocornut
bca5a69928 BeginMenu()/MenuItem(): fixed accidental triggering of child menu items when opening a menu inside a small host window forcing the child menu window to be repositioned under the mouse cursor. (#8233, #9394)
nb: ImGuiSelectableFlags_NoHoldingActiveID is not used anymore. Would remove remove once we remove the unnecessary call to Selectable() from MenuItem().
2026-05-11 15:32:39 +02:00
ocornut
eb453f2be6 Checkbox, Style: added ImGuiCol_CheckboxSelectedBg. (#9392) 2026-05-11 14:30:34 +02:00
ocornut
6df50a0667 (Breaking) DrawList: swapped the last two arguments of AddRect(), AddPolyline(), PathStroke(). thickness<>flags.
Added inline redirection functions when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is off.
Marked the old functions are =delete when IMGUI_DISABLE_OBSOLETE_FUNCTIONS is on, to allow for better type-checking.
The aim is to be able to use/add flags to more ImDrawList functions, and making existing functions consistents was deemed very desirable.
2026-05-07 16:37:57 +02:00
Mikko Mononen
691b89baae ImDrawList: added AddLineH(), AddLineV() helpers. (#9360)
This commit is aimed to be a lossless transform. Further layout fixes in subsequent commits.
2026-04-28 17:04:54 +02:00
ocornut
c0b693b1d4 MultiSelect: Box-Select + Tables: fixed when using SpanAllColumns paths. (#9383, #7994)
Amend d1a8995 which didn't fix the thing it claimed to fix, as my naive last minute refactor broke it.
2026-04-28 15:58:21 +02:00
Alexander "FireFox" Ong
865a6dfa59 InputScalar: fixed not parsing user input when the display format is configured not to show the scalar value. (#9385)
Useful e.g. for displaying "mixed" inputs, where a single field might represent multiple different values.
2026-04-28 15:25:12 +02:00
ocornut
d1a8995634 MultiSelect: Box-Select + Tables: fixed when using SpanAllColumns paths. (#9383, #7994)
Amend ac88294 + d7b40ab
2026-04-28 14:58:47 +02:00
ocornut
10c378cdfc InputInt, InputFloat, InputScalar: reinstated and fixed ImGuiInputTextFlags_EnterReturnsTrue. (#8665, #9299, #8065, #3946, #6284, #9117) 2026-04-24 15:15:19 +02:00
ocornut
f2f843c113 Fixed some extremely zealous warnings (GCC -Wconversion, -Wdouble-promotion)
(amend a1e0552)
2026-04-23 17:23:43 +02:00
ocornut
382b99c334 PlotHistogram: add comments. (#9372) 2026-04-21 22:32:01 +02:00
ocornut
d7b40ab9a9 MultiSelect: Box-Select + Tables: Amend ac88294. fix usage of box-selection columns with items straying out of columns. (#7994, #2221) 2026-04-20 11:46:36 +02:00
ocornut
ac88294b4a MultiSelect: Box-Select +Tables: fix usage of box-selection columns with items straying out of columns. (#7994, #2221)
Use 00d3f9295e.
+ Assets Browser toggle to enable ScrollX.
2026-04-20 11:12:43 +02:00
ocornut
ea1c04f7ab Multi-Select + Tables: fixed an issue which could lead to an extra vertical offset in the Header row. (#8250, #7994)
Because BeginMultiSelect() does `ms->ScopeRectMin = window->DC.CursorMaxPos = window->DC.CursorPos` at a time where CursorPos is already past MaxPos.y because of ItemSpacing.y. Accumulate spacing.
2026-04-17 19:23:10 +02:00
ocornut
97939e6837 Multi-Select: Box-Select: fixes for using accross nested child windows. (#8364)
- IsFocused scan nav focus route.
- When covering multiple windows, draw in front most ones (grabbed FindFrontMostVisibleChildWindow() from docking branch).
2026-04-17 16:36:09 +02:00
ocornut
c91b03060d Multi-Select: Box-Select: improve dirty unclip rectangle calculation + use in ImGuiMultiSelectFlags_BoxSelect1d mode when needed (e.g. wheel scrolling up). (#7994, #8250, #7821, #7850, #7970) 2026-04-17 14:38:12 +02:00
ocornut
a2eb6d99ed MultiSelect: Box-Select +Tables: revert 4d00bf8ad which seems unneeded since enforce table layout in BeginMultiSelect(). (#7970, #7821). 2026-04-16 23:59:44 +02:00
ocornut
2cbdb7a337 TextLink(), BeginCombo(): fixed two remainig instances of needlessly scanning for ##. 2026-04-16 16:47:13 +02:00
ocornut
d4783bd553 Added missing Test Engine hooks for PlotXXX(), VSliderXXX(), TableHeader(). 2026-04-16 16:39:07 +02:00
ocornut
ce855cada2 Tables, Multi-Select: Fixed an issue using Multi-Select within a Table causing column width measurement to be invalid when trailing column contents is not submitted in the last row. (#9341, #8250) 2026-04-16 15:21:56 +02:00
ocornut
39e7bf5a08 Separator(): enforce a minimum border size if style.SeparatorSize is 0.0f. (#9369) 2026-04-16 11:32:40 +02:00
ocornut
19753a30d8 Multi-Select: Box-Select+Tables: fixed Column return value when UnClipRect is active. (#7994, #8250)
Amend 6ce4b44 + bbd0af7. This probably should be redesigned to be more generic, e.g. move UnclipRect concept outside of Boxselect.
2026-04-15 15:08:49 +02:00
ocornut
ed4dd679f1 Fixed vertical scrollbar top coordinates when using thick borders on windows with no title bar and no menu bar. (#9366) 2026-04-14 16:39:08 +02:00
ocornut
bbd0af7256 Multi-Select: Box-Select+Tables: fixed using BeginMultiSelect() before table layout is locked. (#8250) 2026-04-13 16:19:45 +02:00
ocornut
f83a378d62 TabBar: changed edge's TabItem ClipRect to not pass an inverted PushClipRect().
While not currently a problem, it would be if ImRect::Overlaps() is changed to use <= instead of < (cc: #3976 which deal with Contains but sort of similar topic).
Changing ImDrawList::PushClipRect()'s intersect_with_current_clip_rect path to use ClipRectFull() would also fix this, but it may ambiguous there which behavior would be correct.
Amend 1ec464eb9.
2026-04-13 14:11:19 +02:00
ocornut
2dc64f99bc Minor optimization: reduce redudant label scanning in common widgets.
Missing stuff from 11de9df.
The 6 remaining use of CalcTextSize(...,true) don't need this.
2026-04-10 18:37:08 +02:00