1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00
Commit Graph

214 Commits

Author SHA1 Message Date
Mike Precup
1ad3b9986e Speed up deletion in large trees via the Scene Tree Dock 2025-10-22 22:46:24 -07:00
Thaddeus Crews
ed4f4d275e Merge pull request #110904 from YeldhamDev/tree_drag_unfolding
Unfold tree items on hover while drag-n-dropping
2025-10-21 15:11:01 -05:00
chocola-mint
19c47c5d99 Remove #include "scene/main/timer.h" from control.h 2025-10-05 14:41:06 +09:00
Thaddeus Crews
f6aa5ba23c Merge pull request #97210 from AleksLitynski/object-snapshot-debugger
Add an ObjectDB Profiling Tool
2025-10-03 12:01:11 -05:00
Thaddeus Crews
6b9acd7e9e Merge pull request #110055 from dagarsar/tree-rtl
Add helper methods to convert right-to-left `Rect2i` and `Point2i` in `Tree`'s `draw_item`
2025-10-01 13:12:34 -05:00
Aaron Franke
1a7be001d2 Use const Array ref in set_structured_text_bidi_override_options 2025-09-26 14:31:38 -07:00
Michael Alexsander
26745b4b87 Unfold tree items on hover while drag-n-dropping
Co-authored-by: suddjian
2025-09-26 14:38:45 -03:00
danielgsilva
bc9c14da7a Add helper methods and simplify logic 2025-09-25 13:41:15 +01:00
Thaddeus Crews
6f57447710 Merge pull request #109943 from kevinlam508/proper-tree-size-without-scrollbars
Fix tree to update size with scrollbars disabled
2025-09-24 09:59:13 -05:00
danielgsilva
1a77567029 Add method to check if any cell is selected and fix relationship line conditional 2025-09-24 13:44:57 +01:00
danielgsilva
611fc62fe4 Reinstate const parameter in draw_item_rect 2025-08-27 10:27:15 +01:00
Kevin Lam
4c9bd858c7 Fix tree to update size with scrollbars disabled
When scrollbars are disabled, tree size is dependant on item sizes, so this adds missing checks for when to resize. The side effect of the bug was that scrollbars could incorrectly appear when items change at runtime.
2025-08-24 20:00:48 -05:00
Aleksander Litynski
78f1543e35 Add an ObjectDB Profiling Tool
A new tab is added to the debugger that can help profile a game's memory usage.

Specifically, this lets you save a snapshot of all the objects in a running
game's ObjectDB to disk. It then lets you view the snapshot and diff two
snapshots against each other. This is meant to work similarly to Chrome's
heap snapshot tool or Unity's memory profiler.
2025-07-08 16:39:24 +02:00
Micky
76a7c31a5d Rename TreeItem's alt_text to description for consistency
...with Accessibility API
2025-06-14 19:56:30 +02:00
Thaddeus Crews
777f1c10fa Merge pull request #105376 from KoBeWi/quequeque
Queue hover update when creating TreeItem
2025-05-26 11:24:32 -05:00
Haoyu Qiu
7aa9174bc4 Lazy create menu and slider nodes in Tree 2025-05-19 15:59:48 +08:00
Haoyu Qiu
88d922c55e Cleanup header includes in Tree 2025-05-15 14:28:00 +08:00
dugramen
eb973015d6 Tree multiselect with shift up & down arrow keys 2025-04-25 21:47:16 -04:00
Koyper
4766e32419 Fix Tree relationship line 1px width draw bug. 2025-04-14 18:07:03 -05:00
kobewi
ac2179c546 Queue hover update when creating TreeItem 2025-04-14 10:46:03 +02:00
Pāvels Nadtočajevs
b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
Alexander Hartmann
b96e8d5886 Tree: apply comment style guidelines and remove unused variables.
Co-Authored-By: Tomasz Chabora <2223172+KoBeWi@users.noreply.github.com>
Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2025-03-28 18:03:39 +01:00
Thaddeus Crews
d190cc6d6f Merge pull request #100412 from havi05/tree-hover-on-selected
`Tree` highlight selected items on hover
2025-03-13 08:57:18 -05:00
Thaddeus Crews
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
Hilderin
26cbaca446 Fix Tree Mouse hover position 2025-02-16 08:45:09 -05:00
kobewi
886e5d8084 Don't return Tree items outside visible rect 2025-02-02 00:17:41 +01:00
Thaddeus Crews
0dc6b7c056 Merge pull request #101280 from Sauermann/fix-focus-rect-meta-access
Fix `__focus_rect` meta access error when resizing `Tree`
2025-01-27 09:46:23 -06:00
havi05
03caf44f57 Tree - highlight selected items 2025-01-24 08:07:02 +01:00
Aarni Koskela
f134769506 Fix various typos
* Add TODO notes for typos that should be fixed for 5.0

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-01-08 14:47:42 +02:00
Markus Sauermann
2a72f78427 Fix __focus_rect meta access when resizing Tree
`NOTIFICATION_RESIZED` outputs errors, if `select_mode == SELECT_ROW`.
This PR unifies the access to the item focus rect.
2025-01-08 10:53:46 +01:00
HP van Braam
6f7525c396 Improve Scene Tree editor performance
We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

In order to know what Nodes need to be updated we add a
editor_state_changed signal to Node, this is a TOOLS_ENABLED,
editor-only signal fired when changes to Node happen that are relevant
to editor state.

We also now make sure that when nodes are moved/renamed we don't check
expensive properties that cannot contain NodePaths. This saves a lot of
time when SceneTreeDock renames a node in a scene with a lot of
MeshInstances. This makes renaming nodes go from ~27 seconds to ~2
seconds on large scenes.

SceneTreeEditor instances will now also not do all of the potentially
expensive update work if they are invisible. This behavior is turned off
by default so it won't affect existing users. This change allows the
editor to only update SceneTreeEditors that actually in view. In
practice this means that for most changes instead of updating 6
SceneTreeEditors we only update 1 instantly, and the others only when
they become visible.

There is definitely more that could be done, but this is already a
massive improvement. In complex scenes we see an improvement of 10x,
things that used to take ~30 seconds now only take 2.

This fixes #83460

I want to thank KoBeWi, TokisanGames, a-johnston, aniel080400 for
their tireless testing. And AeioMuch for their testing and providing a
fix for the hover issue.
2024-12-12 22:47:05 +01:00
Rémi Verschelde
d2c82a8ffc Merge pull request #97378 from rune-scape/less-const-cast
Get rid of easily removable uses of `const_cast`
2024-12-02 15:50:06 +01:00
rune-scape
d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
A Thousand Ships
77549dd1f3 [Tree] Allow disabling auto generated tooltip for TreeItem 2024-12-01 14:39:51 +01:00
David Giardi
ebe1a2d7ec Add hover state to Tree items display 2024-10-17 00:21:52 +02:00
Haoyu Qiu
3c365a7fa5 Add auto translate mode for cells in Tree 2024-10-01 21:24:10 +08:00
bruvzg
da4f5fb953 [FileSystem Dock] Add symlink indicator and tooltip. 2024-09-06 14:55:07 +03:00
A Thousand Ships
cd4221c1e2 [Tree] Fix error when removing child from Tree
New `last_child` member was not properly updated
2024-08-28 12:40:26 +02:00
aaronp64
040f241f39 Improve Tree performance
Added TreeItem::last_child to avoid needing to iterate through all children to get to the end.  This mainly helps in cases where one TreeItem has many children (1000s), and new children are added to the end, as each add had to iterate through all previously added children.
2024-07-26 11:32:45 -04:00
Fredia Huya-Kouadio
70d450d086 Fix issue causing input lock when drag scrolling a Tree element on touchscreen devices
Prior to this fix, scrolling via mouse drag on touchscreen devices, and
drag&drop operation on a `TreeItem` element would conflict with each other
preventing the drag scroll from being released when the mouse button is
released.

The issue is addressed by disabling drag&drop when drag scrolling is ongoing.
2024-07-18 04:09:54 -07:00
bruvzg
7d4d63b807 Fix Tree and FileSystemList edit popup double events and ESC behavior. 2024-05-17 10:03:52 +03:00
Haoyu Qiu
c78e9c3fbd Fix TreeItem button handling
- Fix incorrect tooltip and `get_button_id_at_position()` when column
  title is visible and when RTL layout is used
- Take `button_margin`, `h_separation`, and `item_margin` into account
2024-04-18 18:51:36 +08:00
Haoyu Qiu
00f0043227 Revert "Correctly display tooltips for buttons in Tree when they overlap cell content"
This reverts commit 8278a5f274.
2024-04-18 17:35:26 +08:00
Rémi Verschelde
c84d3385f7 Merge pull request #88300 from FaycalElOuariachi/add-TreeItem-is_visible_in_tree
Add `is_visible_in_tree` in `TreeItem`
2024-03-05 23:44:29 +01:00
Faycal ElOuariachi
50cf7e1778 Add is_visible_in_tree in TreeItem 2024-03-05 03:38:33 +01:00
Michael Alexsander
612eed164c Add auto translation to Tree 2024-03-01 12:21:45 -03:00
radzo73
de5b0d7103 Add get_button_color(column, id)
Docs should point to Color constuctor instead of just the class, but I unfortunately cannot.
2024-01-28 19:09:20 -05:00
A Thousand Ships
257d03681c Use callable for TreeItem custom draw
Deprecating old functionality
2024-01-23 12:07:43 +01:00
Stanislav Labzyuk
ff8797e980 Implement disabled state for Checkbox in Tree 2023-11-15 17:13:34 +01:00
Yuri Sizov
2924bfd4d3 Register theme properties with ThemeDB 2023-09-11 13:45:23 +02:00