TreeNode: extracted TreeNodeDrawLineToChildNode() for usage by custom widgets (#2920)

This commit is contained in:
ocornut
2025-04-09 12:04:09 +02:00
parent 39f34e1e58
commit 789de09dda
5 changed files with 29 additions and 16 deletions

View File

@@ -57,14 +57,18 @@ Other changes:
one in docking (they accidentally diverged). (#8554)
- TreeNode: added flags to draw tree hierarchy outlines linking parent
and tree nodes: (#2920)
- ImGuiTreeNodeFlags_DrawLinesNone: No lines drawn.
- ImGuiTreeNodeFlags_DrawLinesNone: No lines drawn (default value in style.TreeLinesFlags).
- ImGuiTreeNodeFlags_DrawLinesFull: Horizontal lines to child nodes. Vertical line drawn down to TreePop() position: cover full contents.
- ImGuiTreeNodeFlags_DrawLinesToNodes: Horizontal lines to child nodes. Vertical line drawn down to bottom-most child node.
- Added style.TreeLinesFlags which stores the default setting,
which may be overriden in individual TreeNode() calls.
- Added style.TreeLinesSize (default to 1.0f).
- Added ImGuiCol_TreeLines (in default style this is the same as ImGuiCol_Border).
- The feature adds a little cost as extra data needs to be stored.
- Caveats:
- Tree nodes may be used in many creative ways (manually positioning openable
nodes in unusual ways, using indent to create tree-looking structures, etc.)
and the feature may not accurately represent them in every cases.
- The feature adds a little cost as extra data needs to be stored.
- Nav: fixed assertion when holding gamepad FaceLeft/West button to open
CTRL+Tab windowing + pressing a keyboard key. (#8525)
- Error Handling: added better error report and recovery for extraneous