Merge pull request #103943 from dugramen/scroll-while-dragging

Scroll `EditorInspector` while drag & drop hovering near the edges
This commit is contained in:
Rémi Verschelde 2025-03-28 14:32:20 +01:00
commit 1f127770fc
No known key found for this signature in database
GPG key ID: C3336907360768E1
4 changed files with 61 additions and 0 deletions

View file

@ -1950,6 +1950,12 @@ void EditorInspectorSection::set_bg_color(const Color &p_bg_color) {
queue_redraw();
}
void EditorInspectorSection::reset_timer() {
if (dropping_for_unfold && !dropping_unfold_timer->is_stopped()) {
dropping_unfold_timer->start();
}
}
bool EditorInspectorSection::has_revertable_properties() const {
return !revertable_properties.is_empty();
}
@ -3491,6 +3497,7 @@ void EditorInspector::update_tree() {
if (!vbox_per_path[root_vbox].has(acc_path)) {
// If the section does not exists, create it.
EditorInspectorSection *section = memnew(EditorInspectorSection);
get_root_inspector()->get_v_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(section, &EditorInspectorSection::reset_timer).unbind(1));
current_vbox->add_child(section);
sections.push_back(section);
@ -3891,6 +3898,7 @@ void EditorInspector::update_tree() {
}
EditorInspectorSection *section = memnew(EditorInspectorSection);
get_root_inspector()->get_v_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(section, &EditorInspectorSection::reset_timer).unbind(1));
favorites_groups_vbox->add_child(section);
parent_vbox = section->get_vbox();
section->setup("", section_name, object, sscolor, false);
@ -3910,6 +3918,7 @@ void EditorInspector::update_tree() {
}
EditorInspectorSection *section = memnew(EditorInspectorSection);
get_root_inspector()->get_v_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(section, &EditorInspectorSection::reset_timer).unbind(1));
vbox->add_child(section);
vbox = section->get_vbox();
section->setup("", section_name, object, sscolor, false);
@ -5032,4 +5041,5 @@ EditorInspector::EditorInspector() {
set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style());
set_draw_focus_border(true);
set_scroll_on_drag_hover(true);
}