Commit graph

562 commits

Author SHA1 Message Date
havi05
ab5176dfa5 Tree - fix cusor selection in multi selection-mode 2025-01-05 22:23:51 +01:00
A Thousand Ships
a1846b27ea
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
Rémi Verschelde
08508d2e01
Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +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
9d10e42a41
Merge pull request #98766 from Calinou/tree-drag-and-drop-use-process
Fix Tree drag-and-drop scrolling having low FPS at low Physics Ticks per Second
2024-12-12 14:09:55 +01:00
Rémi Verschelde
e6125ef51b
Merge pull request #98763 from AThousandShips/more_sname_uses
Use `SceneStringName` in more places
2024-12-02 15:50:44 +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
A Thousand Ships
af56d6e8e8
Use SceneStringName in more places 2024-12-02 14:39:16 +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
Thaddeus Crews
1cad5525d6
Merge pull request #96841 from maidopi-usagi/tree_item_height_cache
[Tree] Improve Tree Performance by replacing computed height with TreeItem's cached minimum size
2024-11-10 12:12:45 -06:00
MaidOpi
07b7af0c81 replace computed height with cached item minimum size 2024-11-07 03:28:08 +08:00
Adam Scott
49f918e596
Fix issue where scrolling to item center would overflow on top 2024-11-05 12:50:34 -05:00
Hugo Locurcio
bb813ba7bc
Fix Tree drag-and-drop scrolling having low FPS at low Physics Ticks per Second
Scrolling is now performed in process instead of physics process.
This makes scrolling much smoother if Physics Ticks per Second is lower
than the rendered FPS.
2024-11-02 18:45:28 +01:00
Thaddeus Crews
b7a0971ad2
Merge pull request #97934 from adamscott/give-AThousandShips-a-break
[Codestyle] Set clang-format `RemoveSemicolon` rule to `true`
2024-10-29 19:25:36 -05:00
Thaddeus Crews
4aad050067
Merge pull request #97157 from pafuent/fixing_tree_item_get_prev_wrap
Fix `TreeItem` `get_prev*` methods when `p_wrap` is `true`
2024-10-25 13:03:42 -05:00
Adam Scott
0d350e7108
Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
Thaddeus Crews
b3bcb2dc14
Merge pull request #98299 from timothyqiu/tree-coordinate
Fix button click detection when `Tree` is rotated
2024-10-21 16:39:31 -05:00
Haoyu Qiu
17642692c5 Fix button click detection when Tree is rotated 2024-10-18 22:43:48 +08:00
David Giardi
ebe1a2d7ec Add hover state to Tree items display 2024-10-17 00:21:52 +02:00
Rémi Verschelde
19081a850d
Merge pull request #95889 from KoBeWi/tree_growing_sideways
Allow horizontal scrolling in Tree using Shift
2024-10-04 22:43:17 +02:00
Haoyu Qiu
3c365a7fa5 Add auto translate mode for cells in Tree 2024-10-01 21:24:10 +08:00
Pablo Andres Fuente
9c0afbb15c Fixing TreeItem get_prev_xxx methods when p_wrap is true
Fixes #85032

The code that fix the issue is courtesy of @Jesusemora, I just added
unit tests for it and did a rebase with the latest changes on master.

Co-authored-by: Jesusemora <32273722+Jesusemora@users.noreply.github.com>
2024-09-23 17:11:02 -03:00
Rémi Verschelde
cc52112144
Merge pull request #96643 from bruvzg/fs_links
[FileSystem Dock] Add symlink indicator and tooltip.
2024-09-12 10:28:44 +02:00
Rémi Verschelde
325c1cffc4
Merge pull request #96232 from AThousandShips/tree_navigate_row
[Tree] Improve navigation with row select mode
2024-09-08 23:21:44 +02:00
bruvzg
da4f5fb953
[FileSystem Dock] Add symlink indicator and tooltip. 2024-09-06 14:55:07 +03:00
Rémi Verschelde
13a90e938f
Merge pull request #70096 from rune-scape/stringname-dict
StringName Dictionary keys
2024-09-03 17:38:06 +02:00
Rémi Verschelde
168676a7c5
Merge pull request #96000 from kerstop/deadzone_slider_fix
Fix deadzone slider not working correctly
2024-09-03 11:43:20 +02:00
Rémi Verschelde
68a04bbf9a
Merge pull request #96142 from timothyqiu/one-signal-to-invalidate-them-all
Fix collapsing `TreeItem` not updating horizontal scrollbar
2024-09-02 18:08:07 +02:00
rune-scape
154049ce17 StringName Dictionary keys
also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
2024-08-29 13:39:27 -07:00
A Thousand Ships
5c21c0d8d3
[Tree] Improve navigation with row select mode
Allows navigating with the `ui_left/right` actions when selecting rows,
fixing a navigation inconsistency
2024-08-28 18:32:45 +02:00
Haoyu Qiu
d16dcbb3ac Fix collapsing TreeItem not updating horizontal scrollbar 2024-08-27 11:49:27 +08:00
kerstop
2fd39eca30 fix deadzone slider not working correctly 2024-08-23 12:29:24 -05:00
kobewi
42e5c5b41c Allow horizontal scrolling in Tree using Shift 2024-08-21 10:44:45 +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
Rémi Verschelde
bf20231140
Merge pull request #93179 from TheSofox/tree-nav-crash
Fix engine crashing when using Down Arrow selection on Tree with no selection
2024-06-24 11:14:06 +02:00
Sofox
d86e02580c Fix engine crashing when using Down Arrow selection on Tree with no selection 2024-06-22 18:40:21 +01:00
A Thousand Ships
fbb879debd
[Scene] Add SceneStringNames::text/value_changed 2024-06-19 09:44:38 +02:00
A Thousand Ships
d9e2fc74c7
[Scene] Add SceneStringNames::item_selected 2024-06-19 09:39:05 +02:00
A Thousand Ships
755a0efbb6
[Scene] Add SceneStringNames::id_pressed 2024-05-30 22:54:04 +02:00
bruvzg
7d4d63b807
Fix Tree and FileSystemList edit popup double events and ESC behavior. 2024-05-17 10:03:52 +03:00
kobewi
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
kobewi
9bc5a85b2b Fold TreeItems when clicking to the left of fold icon 2024-05-08 11:30:26 +02:00
Pedro J. Estébanez
eb2bd41fb8 Make handling of rename line-edit popups more robust 2024-05-07 14:29:35 +02:00
A Thousand Ships
308dbb8c63
[Core] Add scalar versions of Vector* min/max/clamp/snap(ped)
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +02:00
Haoyu Qiu
4f4e8589df Fix Tree minimum size calculation
- Take scroll bar space and column title buttons into account
- Fix first column min size sometimes missing one level of indent
- Fix cell min size ignoring text overrun behavior and item inner margin
- Update min size when `hide_root` or `column_title_visible` changes

Wrong description of `item_inner_margin_*` constants is also fixed
2024-04-25 16:00:45 +08:00
Haoyu Qiu
98d7d62350 Fix wrong Tree column title position 2024-04-23 15:46:19 +08: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
Rémi Verschelde
2543d192c3
Merge pull request #90842 from timothyqiu/revert-79792
Revert "Correctly display tooltips for buttons in Tree when they overlap cell content
2024-04-18 12:25:08 +02:00