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

386 Commits

Author SHA1 Message Date
ocornut
3e5dde9a26 Tables: Fixed incorrect auto-fit of parent windows when using non-resizable weighted columns. (#5276) 2022-05-02 16:45:27 +02:00
David Maas
937d073328 Updated comment about Edit.NavigateTo to Edit.GoToAll. (#5179)
This command was renamed in Visual Studio 2017.
2022-04-11 17:11:51 +02:00
ocornut
28ba54a32a Internals: add AddSettingsHandler(), RemoveSettingsHandler(). 2022-03-14 10:23:30 +07:00
ocornut
0f14933577 Tables: Fixed incorrect border height used for logic when resizing one of several synchronized instance of a same table ID, when instances have a different height. (#3955, #3565) 2022-03-01 18:47:03 +01:00
ocornut
88de982071 Version 1.88 WIP 2022-02-08 14:45:26 +01:00
ocornut
c71a50deb5 Version 1.87 2022-02-07 18:16:54 +01:00
ocornut
26d04c948f Tables: Fixed positioning of Sort icon on right-most column with some settings (not resizable + no borders). (#4918). 2022-01-19 18:03:36 +01:00
Jonathan Hoffstadt
83d22f4e48 Tables, ImDrawListSplitter: Fixed erroneously stripping trailing ImDrawList::AddCallback().(#4843, #4844) 2021-12-30 22:03:52 +01:00
ocornut
89a28209e8 Version 1.87 WIP + Backends: OpenGL3: Fixed a buffer overflow in imgui_impl_opengl3_loader.h init, added in 1.86 (#4468, #4830) 2021-12-26 20:02:02 +01:00
ocornut
512c54bbc0 Version 1.86 2021-12-22 15:31:13 +01:00
ocornut
e3bd9434b1 1.86 WIP + internals: tweaks table temp data code. 2021-10-14 16:58:14 +02:00
ocornut
55d35d8387 Version 1.85 2021-10-11 19:24:25 +02:00
ocornut
2de96c4bd5 Stack Tool: Added Stack Tool (ShowStackToolWindow() function and available from Demo and Metrics window). (#4631) 2021-10-06 17:47:27 +02:00
ocornut
3973de7933 Internals: removed last parameter to IsClippedEx() + fix PVS studio warnings. 2021-09-16 18:07:17 +02:00
ocornut
82754561e2 Nav: Fixed a few widgets from not setting reference keyboard/gamepad navigation ID when activated with mouse. 2021-09-13 15:17:54 +02:00
ocornut
d9b427cce0 Nav: clarified/renamed NavInputId as NavAcivateInputId, added flags shared by both.
(this commit should have no visible side effect but is designed to introduce the followup commit refactoring SetKeyboardFocusHere into using a Nav request)
2021-09-07 18:10:31 +02:00
ocornut
0649f750b4 Version 1.85 WIP 2021-08-23 15:31:06 +02:00
ocornut
d2ffbd9b86 Version 1.84
Fix PVS Studio false positive //-V1020
Fix missing #ifndef for IMGUI_IMPL_OPENGL_LOADER_CUSTOM path
2021-08-20 18:03:55 +02:00
ocornut
6b8a059fc9 Internals: moved LastItem data to a shared structure (instead of one per window)
(should be a no-op as we are restoring things in Begin/End. Toward faciliate backup/restore of LastItemData and favor pulling from here instead of CurrentItemFlags, toward #211)
2021-07-19 21:25:47 +02:00
ocornut
b5a2bd1a5b Backends: amends to 1db1066 + merge minor bits from docking incl SetActiveIdUsingNavAndKeys().
No need to clear fields before deletion. DX12: renamed to match docking branch.
2021-06-29 15:25:19 +02:00
ocornut
a15c42d5bd Nav: moved RenderNavHighlight() calls of TreeNode and Selectable out of if (hovered || selected) tests. Should make no difference as NavId currently returns hovered. (#1861, #4242) 2021-06-21 17:38:56 +02:00
ocornut
7c44d067e8 Tables: Fix invalid data in TableGetSortSpecs() when SpecsDirty flag is unset. (#4233)
Amend 4ce6bd8cf, but with usage of ImPool<> bug existed even before 4ce6bd8c. Would only materialize if user called (ableGetSortSpecs and used data without checking SpecsDirty.
2021-06-17 15:18:11 +02:00
ocornut
6ee398ac2b Tables: Added ImGuiTableColumnFlags_Disabled acting a master disable over (hidden from user/context menu). (#3935, #3740) 2021-06-07 15:18:20 +02:00
ocornut
b918751ff4 Tables: Clarified that TableSetColumnEnabled() requires the table to use the ImGuiTableFlags_Hideable flag. (#3935) 2021-06-07 15:09:02 +02:00
ocornut
642426c15b Tables: Fix columns order on TableSetupScrollFreeze() if previous data got frozen columns out of their section. 2021-06-07 11:23:43 +02:00
ocornut
2887a6e07d Tables: made TableUpdateBorders() use IsVisibleX flag. comments. 2021-06-07 10:27:11 +02:00
ocornut
1b4323a1b4 Tables: Added ImGuiTableColumnFlags_NoHeaderLabel to request TableHeadersRow() to not submit label for a column. (#4206) 2021-06-07 09:11:53 +02:00
ocornut
94b680e830 Internals: fixed ImPool:: iteration, rename GetBufSize to GetMapSize. Amend c6c82b9f 2021-06-04 17:27:20 +02:00
ocornut
c6c82b9f1d Internals: fixed iterating ImPool, fix after use of TableRemove() (was only used by TestEngine)
Merge metrics bits from 646c87359
2021-06-03 18:36:43 +02:00
ocornut
e31d13fa76 Version 1.84 WIP 2021-05-25 13:36:53 +02:00
ocornut
ad5d1a8429 Version 1.83 2021-05-24 17:39:25 +02:00
ocornut
4ce6bd8cff Tables: sharing splitter and sort buffers between tables, reducing memory footprints. (#3740)
+ GC pass on that data.
2021-05-07 20:49:52 +02:00
ocornut
32c453ae53 Tables: sharing transient buffers between tables, reducing memory footprints. (#3740) 2021-05-07 20:49:52 +02:00
ocornut
89162a04f4 Fixes for PVS Studio and MSVC static analyzers. Using a macro to suppress single-use MSVC false positives. (#3938, #4073) 2021-04-29 21:20:32 +02:00
ocornut
d28535f351 Fixes for Visual Studio 2019 static analyzers. (#3938, #4073) + two minor edge case were invalid scalar input (e.g. a sign only) would return buffer as modified. 2021-04-29 17:10:27 +02:00
ocornut
770f9daab3 Tables: Better preserve column data (mainly widths) when columns count changes. (#4046) + .ini skips columns with no data. 2021-04-16 18:30:11 +02:00
ocornut
aa5431fde2 Tables: Expose TableSetColumnEnabled() in public api. (#3935) 2021-03-24 14:36:01 +01:00
ocornut
61a0908713 Tables comments + Backends: DirectX9: calling IDirect3DStateBlock9::Capture() after CreateStateBlock() which appears to workaround/fix state restoring issues. . (#3857) 2021-03-18 18:04:52 +01:00
ocornut
412d6f7efe Fixes zealous MSVC static analyzers warnings (#3938)
Other unfixed as I'm not happy with caving to false positives of every analyzers.
2021-03-18 16:10:25 +01:00
ocornut
a1a39c632a Version 1.83 WIP 2021-03-16 14:45:30 +01:00
ANF-Studios
ebe6ac5fb5 Improvements to minor mistakes in documentation comments (#3923) 2021-03-16 12:44:16 +01:00
ocornut
35b1148efb Version 1.82 2021-03-15 20:26:48 +01:00
Rokas Kupstys
c2d6d26139 ImDrawList: upgraded AddRect(), AddRectFilled(), PathRect() to use general ImDrawFlags instead of ImDrawCornersFlags 2021-03-11 16:03:32 +01:00
ocornut
d8c88bd943 Tables: Fixed unaligned accesses when using TableSetBgColor(ImGuiTableBgTarget_CellBg). (#3872)
ImSpanAllocator: Support for alignment.
2021-03-04 09:52:03 +01:00
ocornut
b47aa46d81 Tables: TableSetupColumn() user id uses ImGuiID as intended (typedef ImU32). internals: added GetCurrentTable(), LeftMostEnabledColumn. Demo/docs tweaks. 2021-02-17 12:18:22 +01:00
ocornut
30b7545841 Version 1.82 WIP 2021-02-15 18:10:14 +01:00
ocornut
4df57136e9 Version 1.81 2021-02-10 21:16:58 +01:00
freddii
90a518c501 Fixed typos (#3782) 2021-02-03 12:37:32 +01:00
ocornut
929563c3a7 Log/Capture: Fixes for handling \n in strings. Improve the look of various widgets. Added LogSetNextTextDecoration helper. Fixup/amend dbaf74d75.
For now removed LogRenderedTextNewLine() - it is eventually desirable but currently carries too much ambiguities, so reverted until we have a better system and test suite.
2021-02-02 12:29:58 +01:00
ocornut
9d576a96a5 Tables: added internal TableSetColumnEnabled() helper. Comments. 2021-02-02 09:23:40 +01:00
ocornut
2ed47e5822 Version 1.81 WIP 2021-01-25 16:30:44 +01:00
ocornut
58075c4414 Version 1.80 2021-01-21 20:36:18 +01:00
ocornut
5178c3ce21 Tables: added ImGuiTableFlags_NoHostExtendX instead of using outer_size.x == 0.0f. Changed default outer_size to (0.0f, 0.0f). (#3605) 2021-01-21 16:20:31 +01:00
ocornut
3b409d2b68 BeginChild: half-fixed child window name longer than 255 conflicting, merely raised the limit by using our shared large buffer. Comments. 2021-01-21 12:36:47 +01:00
ocornut
ae0d2dd614 Tables: rework submission of content size and ideal content size to outer window (now using IdealMaxPos introduced in 6af92b0).
See Tests suite "table_reported_size_outer".
2021-01-20 11:38:46 +01:00
thedmd
f379dc28a3 ImBitArray: Rename ClearBits() to ClearAllBits() and add SetAllBits(). ImBitArraySetBitRange work on range [n..n2) instead of [n..n2] 2021-01-20 11:33:59 +01:00
ocornut
3fef132f62 Tables: Clear scroll value when reactivating scroll. Assert when passing width/weight to TableSetupColumn() without an explicit sizing policy at either table or column label.
Clearing scroll was initially made desirable by tests exhibiting side effects but generally feels saner.
table->UserOuterSize is poorly used in this commit but will be by subsequent commits.
2021-01-19 21:55:28 +01:00
ocornut
4d419d1211 Tables: fixed ColumnsAutoFitWidth for resizable fixed columns reporting ideal width. 2021-01-15 17:48:36 +01:00
ocornut
3e712631da Tables: more moving of code in EndTable(), should have no side-effect. 2021-01-15 14:20:24 +01:00
ocornut
626e3e2b3b Tables: fix reported inner-width for scrolling tables off by a small padding amount + moved code.
Makes not much difference for inner-scrolling but makes a difference when reported to outer-window.
2021-01-15 12:40:40 +01:00
ocornut
3edfc042ff Tables: Internals: Renaming, tweaks preparing ahead for trickier changes (should be all no-op). 2021-01-15 11:11:16 +01:00
ocornut
9e281c12a8 Tables: Fixed very small tables edge cases: inverted clip rect with freezing + scroll, missing borders. 2021-01-14 19:16:06 +01:00
ocornut
b0db741770 Demo tweaks. Moved Tabs to Widgets section. Added to Tables demo. Increased version following 00b35c08. 2021-01-14 11:59:33 +01:00
ocornut
00b35c081e Tables: (breaking) removed ImGuiTableColumnFlags_WidthAuto which now can be expressed as _Fixed + _NoResize. WidthRequest gets updated when RequestOutputMaskByIndex is set rather than Visible. 2021-01-13 18:42:02 +01:00
ocornut
8cea3e3ed3 Tables: fixed border straying out of rect when using ImGuiTableFlags_NoBordersInBody with small height. 2021-01-13 12:24:55 +01:00
ocornut
002ba1a69f Tables: comments, tweak. CollapsingHeader: comments. (#3715) 2021-01-13 10:07:59 +01:00
ocornut
31a2f0c164 Tables: fixed outer_width misreported to layout for use with SameLine when ScrollY is set but not ScrollX (#3704, #3414) 2021-01-11 11:31:50 +01:00
ocornut
e18abe3619 Tables: (Breaking) Added ImGuiTableFlags_SizingFixedSame, ImGuiTableFlags_SizingStretchProp. Removed ImGuiTableFlags_SameWidths.
Simplified some code and clariffied that currently non-resizable = always revert to default (while waiting to untangle Fixed vs Auto and programmatic override not going through TableSetupColumn)
Whereas ImGuiTableFlags_SameWidths has some unusual handling of mixed Fixed/Stretch columns, we know treat them separately.
2021-01-08 18:40:52 +01:00
ocornut
0e3ba37e6d Tables: Tidying up. Shuffle some columns fields to facilitate debugging + comments + demo tweaks + metrics highlight. 2021-01-08 18:32:18 +01:00
ocornut
414f82254b Tables: (Breaking) rename ImGuiTableFlags_SizingPolicyFixed > ImGuiTableFlags_SizingFixedFit, ImGuiTableFlags_SizingPolicyStretch > ImGuiTableFlags_SizingStretchSame in prevision for new policies. 2021-01-08 18:10:55 +01:00
ocornut
8b5f3798e0 Tables: Moved demo chunks. Made right-most non-resizable same-width column hidden to alleviate the issue where they are off by 1 pixel. 2021-01-07 17:11:18 +01:00
ocornut
0a5f399805 Tables: Fix hiding column right after the frozen line. Fix hovering/resising column delimiter scrolled under frozen columns. (#3678) 2021-01-03 15:45:56 +01:00
ocornut
eb88fee052 Tables: internal tidying up, calculate WidthAuto in first loop of layout + TableSetupColumn() with unspecified stretch weight leaves it at -1.0f (unset) rather than overrding default. Amend 3b3503e.
Both changes are intended to have no side-effects. Committed separately from upcoming commit for easier future bissecting.
Small demo fix.
2020-12-25 16:30:44 +01:00
ocornut
68faa16e1d Tables: report auto-fit width in EndTable(), extracted TableGetColumnWidthAuto(). fix minor flickering with IsPreserveWidthAuto (which is a debug feature still), moved some code. 2020-12-25 15:52:42 +01:00
ocornut
3573195112 Tables: (breaking) rename ImGuiTableFlags_ColumnsWidthStretch > ImGuiTableFlags_SizingPolicyStretch, ImGuiTableFlags_ColumnsWidthFixed > ImGuiTableFlags_SizingPolicyFixed in prevision for other policies. 2020-12-24 18:32:27 +01:00
ocornut
3fbb928c9f Tables: explicit/custom width in TableSetupColumn() is reapplied when table or column becomes not resizable. Comments. 2020-12-23 12:14:55 +01:00
ocornut
956435768f Tables: (breaking) renamed ImGuiTableColumnFlags_WidthAutoResize to _WidthAuto., default to WidthFixed policy when host window has auto-resize.
Fix edge case with TableSetColumnWidth on small windows (amend 972ca816)
2020-12-23 11:39:15 +01:00
ocornut
d497f112e7 Tables: simplified and tidying up TableSetColumnWidth(), fixes resizing a fixed column surrounded by stretch column (manually or via auto-fit menu). TableHeader() showing highlighted when held. 2020-12-22 17:13:11 +01:00
ocornut
972ca8166f Tables: extracted code for TableGetMaxColumnWidth(), fixing "stuck" resize being lossy as it used an older calculation for it and didn't honor e.g. _NoKeepColumnsVisible 2020-12-22 16:40:52 +01:00
ocornut
1aa59f90d0 Minor API comments and tweaks, standardize index used in imgui.h. Tables: tweaked TableSetupColumn() assert to use IM_ASSERT_USER_ERROR(). 2020-12-22 15:30:26 +01:00
ocornut
2e48c2da81 Removed redirecting functions/enums names that were marked obsolete in 1.63 (August 2018) + tables tweaks. 2020-12-21 19:42:37 +01:00
ocornut
ae63d56426 Tables: remove ImGuiTableFlags_NoHeadersWidth since it is so rarely used and can be specified on a per-column basis. 2020-12-18 19:03:47 +01:00
ocornut
532aa5a69b Tables: (breaking) change outer_size.x default value to -FLT_MIN, make outer_size.x == 0.0f act as ImGuiTableFlags_NoHostExtendX (#3605, ad83976b) when no scrolling and no stretch column. Which is more consistent.
Demo: moved "Compact table" to "Padding" section, makes more sense. Tweaked demo.
2020-12-18 17:51:50 +01:00
ocornut
22ace4438c Tables: clarify assumption that rendering of bg/borders in bg0/bg1 are cpu-clipped allowing frozen/unfrozen to share drawcmd + remove offset on outer borders of scrolling tables. 2020-12-18 14:33:16 +01:00
ocornut
30468829c2 Tables: Internal: Maintain InnerRect to further clarify some code. Renamed Bg1 fields to Bg2 (used by Selectable) as the other handles Bg0+Bg1. 2020-12-18 14:32:51 +01:00
ocornut
ad83976b35 Tables: Added ImGuiTableFlags_NoHostExtendX (#3605) marked as WIP, will probably rename.
Moved some code from BeginTable() to TableUpdateLayout() to late latch some of the required data.
2020-12-18 14:32:51 +01:00
ocornut
c4dbab8f5e Tables: reset all width apply to hidden stretch columns. Comments. 2020-12-16 17:12:21 +01:00
ocornut
1fb26d18c4 Tables: fixed seemingly unnecessarily copy of ImGuiTableColumnFlags_NoDirectResize_ which broken resizing from W3| in a F1 W3 F2 setup. Header only allow overlap on hover, not when active (amend f2df804f)
Otherwise TableUpdateBorders() tends to override mouse cursor.
2020-12-16 15:43:51 +01:00
ocornut
892b48e2d6 Tables: Lock contents width while resizing down an horizontal scrolling table. Headers declare ideal width regardless of clipping. Misc comments. 2020-12-16 13:04:49 +01:00
ocornut
bd899efbd0 Tables: fixed "resize to default" of multiple stretch column (added 3b3503e, broken 7a61f340).
Fixed a warning.
Storing RightMostStretchedColumn column for resizing code.
Avoid clearing RightMostEnabledColumn in BeginTable() so resizing code can potentially use it.
(Added regression tests for resize all to default imgui_dev)
2020-12-14 15:49:20 +01:00
ocornut
f2df804fcc Tables: four small fixes.
Fixed last item flags leaking to disabled column, affecting IsItemHovered(). (#3651).
Validate and fix invalid DisplayOrder data from ini file.
Allow TableHeaderRows() to function will missing TableSetupColumn() calls.
Made TableHeader() use AllowItemOverlap mode to allow submit subsequent item in same cell, since it covers the whole cell area.
2020-12-13 19:57:19 +01:00
ocornut
738606a294 Tables: added ImGuiTableFlags_SortTristate. Renamed ImGuiTableFlags_MultiSortable to ImGuiTableFlags_SortMulti. Removed now unused FlagsIn storage. 2020-12-11 23:01:09 +01:00
ocornut
cad8935bfd Tables: revert setting colum cliprect.max.x to WorkMax.x instead of Max.x at it complicates header code. Fix clipped sort arrow. (amend 17536f9a) 2020-12-11 21:31:55 +01:00
ocornut
bff1836922 Internals: added facility to hide windows from render without interfering with the HiddenFramesCanSkipItems/HiddenFramesCannotSkipItems fields which have effects on layout. Compact some fields.
Ideally we'd have a simpler system but it's not easy to make the capture system change to hook at the right spot. Will rework.
2020-12-11 14:37:58 +01:00
ocornut
1ad5502f18 Tables: Closer to zero-clear constructor. Lazily clearing name offsets to avoid an iteration in BeginTable(). Removed unused TableSetColumnIsEnabled(), signature went faulty anyway. 2020-12-10 19:45:20 +01:00
ocornut
76964a27ce Tables: moved TableNextRow(), TableBeginRow(), TableEndRow(), TableNextColumn(), TableBeginCell(), TableEndCell() to their own section. 2020-12-10 18:39:37 +01:00
ocornut
e6b875c09b Tables: Ditch old columns flags/setting if not called again. Displaying right-most border when using _SameWidths. Moving Width-related functions to their own section.
Effectively removed the TableFixColumnFlags() in first loop of TableUpdateLayout() to replace it with similar one but only when column not declared. I think this should be the right thing.
2020-12-10 18:33:33 +01:00
ocornut
17536f9add Tables: more consistent use of CellPadding.x*2 and clip-rect on right-most side of non-bordered column + fix cellbg for standalone TableHeader call.
Using CellPadding.x on both sides when BorderV is off, generally most consistent and with default value (4,2) promotes at-glance visible spacing between non-bordered columns. Effectively double horizontal padding on non-bordered columns.
Made ClipRect.Max.x matches WorkMaxX which is where we'd like to go for windows themselves.
TableHeader() submit single cell bg color if not already submitted as a full header row.
Misc comments/docs updates.
2020-12-09 15:13:09 +01:00
ocornut
0b14dd9e55 Tables: fixed propagation of line height from outside the table. Added outer-width demo. 2020-12-04 19:15:27 +01:00
ocornut
6e38026627 Tables: changelog. removed TableGetHoveredColumn() from public API in favor of using TableGetColumnFlags(). renamed ImGuiTableSortSpecsColumn to ImGuiTableColumnSortSpecs. 2020-12-04 19:15:27 +01:00
ocornut
7a61f3407b Tables: support internal TableResetSettings(), clarify lifetime, fixed missing auto-fit on column unhidden after first run, fixed resize assert when changing column sizing policy to stretch mid-frame (before of -1.0f weight) 2020-12-04 19:15:27 +01:00
ocornut
b194df413c Tables: exposed status flags via TableGetColumnFlags(), removed TableGetColumnIsSorted()
Scoped width auto calc.
2020-12-04 19:15:27 +01:00
ocornut
984c4cb5f8 Tables: distinguishing per-column IsVisible from IsRequestOutput which is returned to user. Clarified clipping rules/requirements. Comments. 2020-12-04 19:15:27 +01:00
ocornut
f70bf69e3b Tables: comments and tweaks on TableUpdateLayout(). changed "apply final width" loop to use natural column order. 2020-12-04 19:15:26 +01:00
ocornut
155b8bb816 Tables: Shared menu item id for "Size all" variations. Avoid allocation on single sort specs. Fix TableGetColumnIsEnabled(). Massage TableHeaderRows(). 2020-12-04 19:15:26 +01:00
ocornut
e126a64782 Tables: using a typedef in internal code to specify column/draw channel index storage. 2020-12-04 19:15:26 +01:00
ocornut
6aa8388e9f Tables: index tweaks, fixed some inconsistent spacings. 2020-12-04 19:15:26 +01:00
ocornut
5877b9d722 Tables: moved TablePushBackgroundChannel(), TablePopBackgroundChannel(), TableDrawBorders() to their own section. 2020-12-04 19:15:26 +01:00
ocornut
5180025de5 Tables: moved + renamed TableSetupDrawChannels(), TableMergeDrawChannels() to their own section. 2020-12-04 19:15:26 +01:00
ocornut
b7c83e4bac Tables: moved TableGetSortSpecs(), TableGetColumnIsSorted(), TableFixColumnSortDirection(), TableSetColumnSortDirection() to their own section. 2020-12-04 19:15:26 +01:00
ocornut
d6b1f0d13d Tables: moved TableHeadersRow(), TableHeader() to their own section. 2020-12-04 19:15:26 +01:00
ocornut
592fc69054 Tables: moved TableDrawContextMenu(), TableOpenContextMenu() to their own section. 2020-12-04 19:15:26 +01:00
ocornut
7aed4b152b Tables: improve index, file structure tweaks. 2020-12-04 19:15:26 +01:00
ocornut
082f1d10d0 Tables: renamed TableBeginUpdateColumns to TableBeginApplyRequests, moved code to TableUpdateLayout, in order to ensure that enable state is not inconsistent due to TableSetupColumn column hiding requests.
All the fields moved from TableBeginUpdateColumns to TableUpdateLayout are not used before.
2020-12-04 19:15:26 +01:00
ocornut
79c9eaa78e Tables: Internals: renamed Visible to Enabled to avoid confusion with visibility checks. 2020-12-04 19:15:26 +01:00
ocornut
5ef7b831c2 Tables: removed ImGuiTableSortSpecs::ColumnsMask because it needlessly exposes our 64-columns limitation which we'd eventually would like to lift
+ shuffle declarations in internals
2020-12-04 19:15:26 +01:00
ocornut
e09454aec4 Tables: removed TableGetColumnIsVisible from public api, re-specced as TableGetColumnIsHidden() returning same flag as setter, clipper increase CurrentRow. 2020-12-04 19:15:26 +01:00
ocornut
a70c6aae9f Tables: demo synced tables + fix resizing indented synced tables. 2020-12-04 19:15:26 +01:00
ocornut
0c9ab0acdd Tables: setup and maintain ItemWidth per column. 2020-12-04 19:15:26 +01:00
ocornut
8f126d5d95 Tables: rename ImGuiTableFlags_SizingPolicyStretchX to ImGuiTableFlags_ColumnsWidthStretch, ImGuiTableFlags_SizingPolicyFixedX to ImGuiTableFlags_ColumnsWidthFixed. 2020-12-04 19:15:26 +01:00
ocornut
41f89e0f59 Tables: added ImGuiTableFlags_SameWidths, used in demo. Reordered columns flags and exposed them all in Columns Flags section. 2020-12-04 19:15:26 +01:00
ocornut
3a2f0bfc04 Tables: demo inner_size + scrollx + stretch, added TableGetRowIndex(), renamed _WidthAlwaysAutoResize to _WidthAutoResize. 2020-12-04 19:15:25 +01:00
ocornut
3b3503e60f Tables: decent support for auto-resize of stretch columns (trickier than it sounds)
Four cases:
1. visible columns are all stretch, resize all : "size all to default" reset to default weight
2. visible columns are all stretch, resize one: "size one to fit" set weight, reapply weight (todo: improve weight redistribution in case of >1 siblings)
3. visible columns are mixed, resize all: "size all to fit/default" reset stretchs to default weight, set fixed to auto width
4. visible columns are mixed, resize one: "size one to fit", redistribute weight the same way as a manual resize
+ TableSetupColumn() more consistently clear AutoFitQueue.
+ zero-clear RowCellData buffer.
2020-12-04 19:15:25 +01:00
ocornut
c5dcf2fde1 Tables: rework keep-visible/max-width code to be less incorrect, but right-most column may effectively has few pixels less of visible cliprect width.
See table_width_distrib and table_width_keep_visible tests.
+ fix minor left-side clipping on post-frozen column
+ made TableHeader() use reliable column->MaxX
2020-12-04 19:15:25 +01:00
ocornut
197e9c085b Tables: separate bg0 and bg1 draw channels, selectable above bg color + will facilitate drawing of borders in EndTable().
+ unused code to strip out dummy draw channel calls.
2020-12-04 19:15:25 +01:00
ocornut
52f24df668 Tables: comments, tweaks, added internal TableSetColumnVisible(), merged the two TableSetColumnWidth(). 2020-12-04 19:15:25 +01:00
ocornut
bf197c74f6 Tables: storing WorkMaxX, made offset_x == MinX to be clearer, clip rect merge uses ClipRect.max.x directly, removed unused ShrinkWidth code, metrics. 2020-12-04 19:15:25 +01:00
ocornut
5465d30d67 Tables: added ImGuiTableFlags_PreciseStretchWidths. 2020-12-04 19:15:25 +01:00
ocornut
10db896813 Tables: store RawData in a simple void* pointer, rename ContentMinX > WorkMinX, misc tidying up.
Removed unnecessary casts when using CheckboxFlags().
2020-12-04 19:15:25 +01:00
ocornut
82cf41d804 Tables: tooltip on clipped TableHeader() (amended) 2020-12-04 19:15:25 +01:00
ocornut
507db499e4 Tables: work on background draw channel handling (amend "create a separate background draw channel") + Selectable disable spacing when spanning. 2020-12-04 19:15:25 +01:00
ocornut
fe6131168a Tables: Additionally commentary about clipper in the demo + minor padding tweak. 2020-12-04 19:15:25 +01:00
ocornut
94d99f9d0b Tables: Fixed crash when increaasing columns count with bound settings. 2020-12-04 19:15:25 +01:00
ocornut
24a7c45b02 Tables: Fix for 64 columns (maximum of 131 temporary draw channels). 2020-12-04 19:15:25 +01:00
ocornut
e5a5256971 Tables: Garbage collection to relieve draw splitter buffers + for test engine: compact settings, remove table. 2020-12-04 19:15:25 +01:00
ocornut
f80097ca96 Tables: Fix applying WorkRect in non-scrolling tables. Fix inverted BackgroundClipRect being passed to ImDrawCmd. 2020-12-04 19:15:25 +01:00
ocornut
557253e776 Tables: create a separate background draw channel for rows below the frozen line. 2020-12-04 19:15:24 +01:00
ocornut
fae362fd0b Tables: fixed auto-fitting columns not marking settings as dirty + fixed CellBg fill not narrow clipping on ScrollX + freeze. 2020-12-04 19:15:24 +01:00
ocornut
9918b2f147 Tables: Shuffled ordering of draw channels merge group so vertically unfrozen ones come, allowing us to split background channels in two. 2020-12-04 19:15:24 +01:00
ocornut
d3222086f0 Tables: Moved TableSetupScrollFreeze(), TableUpdateDrawChannels() lower in more adequate spots.
+ rename IsFreezeRowsPassed to IsUnfrozen.
2020-12-04 19:15:24 +01:00
ocornut
d9ca3939e1 Tables: Tidy up comments. Replaced some Columns by Tables in demo. Removed ImGuiTableFlags_Scroll (combining ScrollX/ScrollY) because each axis inccur different requirements/constraints. 2020-12-04 19:15:24 +01:00
ocornut
51abdd53e3 Tables: renamed somehow-duplicate ContentWidth members (implicitly == Max - Min), renamed StartX to ContentMinX for consistency. 2020-12-04 19:15:24 +01:00
ocornut
1731ae5a09 Tables: Reworked padding/spacing/width.
All widths are stored without padding.
Decorelate padding from presence of border.
Added ImGuiTableFlags_Pad/NoPad flags.
Added demo.
Merge StartXHeaders and StartXRows into StartX.
Distinguish CellSpacingX1 and CellSpacingX2 for clarity and to avoid loss of width on non-even spacing values.
2020-12-04 19:15:24 +01:00
ocornut
75c5f534e8 Tables: Avoid allocating into ColumnsName for empty strings, changed TableGetColumnName() to return "" on missing name, generally more friendly. 2020-12-04 19:15:24 +01:00
ocornut
f4800db178 Tables: Extracted parts of BeginTable() into TableFixFlags() and TableBeginInitMemory(). 2020-12-04 19:15:24 +01:00
ocornut
ac5b1648e6 Tables: Various internal renaming + merge StartXHeaders/StartXRows into StartX. 2020-12-04 19:15:24 +01:00
ocornut
77e561aaf3 Tables: Made demo options consistently compact, replaced constants with font-based sizes, added comments on memory allocations. 2020-12-04 19:15:24 +01:00
ocornut
02b27b75a4 Tables: Added ImGuiTableFlags_NoBordersInBody, ImGuiTableFlags_NoBordersInBodyUntilResize, removed ImGuiTableFlags_BordersFullHeightV. 2020-12-04 19:15:24 +01:00
ocornut
172704c079 Tables: Add demo code. Remove dead code + seemingly duplicate border in TableDrawBorders(). 2020-12-04 19:15:24 +01:00
ocornut
2ee20fdb7c Tables: Frozen rows/columns in nav menu layer, fixed conflict between column id and holding child id. 2020-12-04 19:15:24 +01:00
ocornut
e66b28693a Tables: Added ImGuiTableFlags_ContextMenuInBody flag.
Worked to get TableOpenContextMenu() in public API but kept it internal.
2020-12-04 19:15:24 +01:00
ocornut
6182973bde Tables: (Breaking) Rename TableNextCell() to TableNextColumn(), made TableNextRow() NOT enter into first column. 2020-12-04 19:15:24 +01:00
ocornut
b1ebf964f5 Tables: Moved TableSetColumnIndex() next to TableNextCell() since they are so similar + made NextCell() crash proof. 2020-12-04 19:15:24 +01:00
ocornut
248960d64c Tables: Fix ImGuiTableColumnFlags_WidthAlwaysAutoResize columns when clipped (which would be default behavior without _Resizable and when clipping/scrolling) 2020-12-04 19:15:23 +01:00
omar
25b5cc2f95 Tables: Fixes to support any number of frozen rows (over modifications to clipper code in master) + make clipper run eval after clipect update 2020-12-04 19:15:23 +01:00
ocornut
cc12ea084b Tables: Added TableSetColumnSortDirection() + added in default context menu code (disabled, feels unnecessary, but work is done to ensure programmatic access) 2020-12-04 19:15:23 +01:00
ocornut
9b37087fbe Tables: (Breaking) Rename TableAutoHeaders() to TableHeadersRow() + added TableGetColumnCount(). 2020-12-04 19:15:23 +01:00
ocornut
3021608392 Tables: (Breaking) Add TableSetupScrollFreeze() api, remove ImGuiTableFlags_ScrollFreezeXXX flags, tweak comments, move columns block.
Avoid awkwardly named ScrollFreeze flags, raise limit over 3, and will allow for future api maybe freezing bottom/right side.
2020-12-04 19:15:23 +01:00
ocornut
36b2f3b4f1 Tables: renamed ImGuiTableFlags_NoClipX to ImGuiTableFlags_NoClip, clarified purpose, moved lower in the list as it doesn't need to be so prominent. 2020-12-04 19:15:23 +01:00
omar
8ec05fc034 Tables: Fixed holding on table pointers accross resize/invalidation of the pool buffer. 2020-12-04 19:15:23 +01:00
omar
931829f701 Tables: (Breaking change) Sorting: Made it users responsability to clear SpecsDirty back to false, so TableGetSortSpecs() doesn't have side-effect any more. + comments 2020-12-04 19:15:23 +01:00
ocornut
f6800e9d3b Tables: Extend outer-most clip limits to match those of host when merging draw calls.
Generally clarify/simplify ClipRect extending/merging code in TableReorderDrawChannelsForMerge().
Amend/fix Sep 23
2020-12-04 19:15:23 +01:00
ocornut
3d573103b6 Tables: Fixed lower clipping when using ImGuiTableFlags_NoHostExtendY. 2020-12-04 19:15:23 +01:00
omar
8e97cdf8e8 Tables: Fix for calling TableSetBgColor(ImGuiTableBgTarget_CellBg) multiple times on the same cell. 2020-12-04 19:15:23 +01:00
ocornut
45a80716b1 Tables: Fixed three bugs + metrics tweaks.
- Fixed bug when ending a table within another (outer table column offset was overwritten instead of restored).
- Fixed assert when settings data has mismatching column count.
- Fixed restoring g.CurrentTable when calling EndChild() from inside table inner window.
- Made inactive tables grey in metrics.
- Fix warning.
(amended twice)
2020-12-04 19:15:23 +01:00
omar
eb18636e02 Tables: Fix settings not being saved in child window (issue 3367) + fix for change in master. 2020-12-04 19:15:23 +01:00
omar
9d8b40414a Tables: Added TableSetBgColor() api with color for RowBg and CellBg colors. 2020-12-04 19:15:23 +01:00
omar
b6405a291d Tables: Fixed TableHeader() not declaring its height properly. Do NOT declare width. 2020-12-04 19:15:23 +01:00
omar
0847373b98 Tables: Comments on Sizing Policies + Rename border V/H flags HInner -> InnerH + offset every flags by two. 2020-12-04 19:15:23 +01:00
omar
30e21eb280 Tables: non-resizable columns also submit their requested width for auto-fit, 2020-12-04 19:15:22 +01:00
omar
a0e6aa1766 Tables: Fix calculation of auto-fit (remove padding). Demo setting a width in columns setup + ImGuiTableFlags_NoKeepColumnsVisible. 2020-12-04 19:15:22 +01:00
omar
c96c84b6dc Tables: Store submitted column width and avoid saving default default widths. 2020-12-04 19:15:22 +01:00
omar
57916b891b Tables: Simplified TableHeader() and not relying on Selectable(), fixed various padding issues. Added work-around for CellRect.Min.x offset by CellSpacing.x. 2020-12-04 19:15:22 +01:00
omar
fcdfde2bc6 Tables: Extracted border size into a named variable. 2020-12-04 19:15:22 +01:00
omar
03c8bfaf23 Tables: Removed extra +1.0f pixels initially allocated to make right-most column visible, fix visible padding asymmetry. Tweaked debug code in demo.
Seems visible enough without. Whole thing is/was fishy, may return to it but right cleaning up seems viable.
2020-12-04 19:15:22 +01:00
omar
745d8cdb49 Tables: Made TableHeader() responsible for opening per-column context menu to move responsibility away from TableAutoHeaders(). 2020-12-04 19:15:22 +01:00
ocornut
27e779b3ef Tables: Removed dubious window->SkipItem assignment in TableAutoHeaders(). 2020-12-04 19:15:22 +01:00
ocornut
7ca70dcb81 Tables: Using same seed ID regardless of when using a child window or not. 2020-12-04 19:15:22 +01:00
ocornut
798aed729a Tables: Added TableGetHoveredColumn(), extracted some context menu code out, simplifying TableAutoHeaders() toward aim of it being a user-land function. 2020-12-04 19:15:22 +01:00
ocornut
4c4882ffe4 Tables: Fixed channel merge when resizing columns with headers. Disable unnecessary and broken merge when using _NoClipX. 2020-12-04 19:15:22 +01:00
omar
8530b6af3d Tables: Not flagging whole column as SkipItems based on clipping visibility (breaks layout) 2020-12-04 19:15:22 +01:00
omar
363eae94e6 Tables: Further fix #3293, #3163 + fixed for row unfreezing border not always showing due to unset clip rect. 2020-12-04 19:15:22 +01:00
omar
b741639468 Tables: Fix rendering of row bg and line separators (#3293, broken by fixes #3163, code was accidently relying on SetCurrentChannel not updating rectangle)
+ Used shortcut in PushTableBackground/PopTableBackground
2020-12-04 19:15:22 +01:00
ocornut
58411f27cb Tables: Avoid TableGetSortSpecs() having a side-effect on sort specs sanitization. 2020-12-04 19:15:22 +01:00
ocornut
dc915c86ca Tables: Fixed a manual resize path not marking settings as dirty, TableSortSpecsSanitize() doesn't need to test table->IsInitializing 2020-12-04 19:15:22 +01:00
Rokas Kupstys
8690d1f9ce Tables: Fix sort specs sometimes incorrectly reporting sort spec count when table loses _MultiSortable flag during runtime. 2020-12-04 19:15:22 +01:00
ocornut
af992d1321 Tables: Tweak settings functions to more prominently clarify the two levels of function. 2020-12-04 19:15:22 +01:00
omar
7513842284 Tables: Fix assert/crash when a visible column is clipped in a multi clip group situation. 2020-12-04 19:15:22 +01:00
omar
e41fc7b5b0 Tables: Fix TableDrawMergeChannels() mistakenly merging unfrozen columns cliprect with host cliprect. Comments, debug. 2020-12-04 19:15:21 +01:00
omar
fec9d7d226 Tables: Rescale fixed widths when font size change to support varying dpi scale at runtime and on .ini reload. 2020-12-04 19:15:21 +01:00
omar
6bc0bbccf3 Tables: Restore width/weight saving/loading code. Non-weighted width currently not font/DPI change friendly. 2020-12-04 19:15:21 +01:00
omar
af52a0cea2 Tables: Resizing weighted column preserve sum of weights. Fix ResizedColumn init leading to undesirable TableSetColumnWidth() on first run. Rework TableSettingsHandler_ReadLine() structure to allow other types of line. 2020-12-04 19:15:21 +01:00
omar
bc170e7325 Tables: Renamed ResizeWeight->WidthStretchWeight, WidthRequested->WidthFixedRequest, clarififications, comments. 2020-12-04 19:15:21 +01:00
omar
23c60b2814 Tables: Renamed internal fields: Active->Visible, Visible->VisibleUnclipped to be less misleading. 2020-12-04 19:15:21 +01:00
omar
dff26191bd Tables: Try to report contents width to outer window, generally better auto-fit. 2020-12-04 19:15:21 +01:00
omar
466b6e619a Tables: Fixed incorrect application of CursorMaxPos.x (3162) 2020-12-04 19:15:21 +01:00
omar
95c273618e Tables: Allow hot-reload of settings (merge policy), tidying up settings code 2020-12-04 19:15:21 +01:00
omar
9b6d0fdb7a Tables: Fixed ignoring DefaultHide or DefaultSort data from flags when loading settings that don't have them. 2020-12-04 19:15:21 +01:00
omar
9f43aae226 Tables: Calculating ideal total width, some renaming, comments. Clarify that inner_width is unused with ScrollX=0. Clip many comments to 120 columns. 2020-12-04 19:15:21 +01:00
omar
b7ff85d9ad Tables: Browse settings list in Metrics (outside of Table entry). 2020-12-04 19:15:21 +01:00