@@ -201,6 +201,8 @@ void GroupsEditor::_update_tree() {
201201 TreeItem *root = tree->create_item ();
202202
203203 TreeItem *local_root = tree->create_item (root);
204+ local_root->set_cell_mode (0 , TreeItem::CELL_MODE_CUSTOM);
205+ local_root->set_custom_draw_callback (0 , callable_mp (this , &GroupsEditor::_highlight_subsection_root));
204206 local_root->set_text (0 , TTR (" Scene Groups" ));
205207 local_root->set_icon (0 , get_editor_theme_icon (SNAME (" PackedScene" )));
206208 local_root->set_custom_bg_color (0 , get_theme_color (SNAME (" prop_subsection" ), EditorStringName (Editor)));
@@ -238,6 +240,8 @@ void GroupsEditor::_update_tree() {
238240 keys.sort_custom <NoCaseComparator>();
239241
240242 TreeItem *global_root = tree->create_item (root);
243+ global_root->set_cell_mode (0 , TreeItem::CELL_MODE_CUSTOM);
244+ global_root->set_custom_draw_callback (0 , callable_mp (this , &GroupsEditor::_highlight_subsection_root));
241245 global_root->set_text (0 , TTR (" Global Groups" ));
242246 global_root->set_icon (0 , get_editor_theme_icon (SNAME (" Environment" )));
243247 global_root->set_custom_bg_color (0 , get_theme_color (SNAME (" prop_subsection" ), EditorStringName (Editor)));
@@ -831,6 +835,14 @@ void GroupsEditor::_node_removed(Node *p_node) {
831835 }
832836}
833837
838+ void GroupsEditor::_highlight_subsection_root (Object *p_item, const Rect2 p_rect) {
839+ TreeItem *item = Object::cast_to<TreeItem>(p_item);
840+ ERR_FAIL_NULL (item);
841+
842+ const Ref<StyleBox> &stylebox = get_theme_stylebox (SNAME (" style_highlight_subsection" ), EditorStringName (Editor));
843+ stylebox->draw (tree->get_canvas_item (), p_rect);
844+ }
845+
834846GroupsEditor::GroupsEditor () {
835847 node = nullptr ;
836848 scene_tree = SceneTree::get_singleton ();
0 commit comments