UI: Tree View: Operator to delete with X key

Tree view elements can be deleted by the remove operator located on the
right side with `-` icon. But these operators are different for every
type. Now introduced `UI_OT_view_item_delete`. With that it is possible
to delete elements with X key when mouse is over tree view. In future
maybe we could remove type specific operators (for example: `GREASE_PENCIL_OT_layer_remove`).

See video in PR description

Pull Request: https://projects.blender.org/blender/blender/pulls/144045
This commit is contained in:
Pratik Borhade
2025-08-16 08:21:49 +02:00
parent b856b6010e
commit e297fb4f14
9 changed files with 95 additions and 0 deletions

View File

@@ -1048,6 +1048,8 @@ def km_user_interface(_params):
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("range_select", True)]}),
("ui.view_item_rename", {"type": 'F2', "value": 'PRESS'}, None),
("ui.view_item_delete", {"type": 'X', "value": 'PRESS'}, None),
("ui.view_item_delete", {"type": 'DEL', "value": 'PRESS'}, None),
])
return keymap