Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

rename hierarchy node using hotkey #10963

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ function HierarchyPanelContents(props: { sceneURL: string; rootEntity: Entity; i
}
})

useHotkeys(`${cmdOrCtrlString}+r`, (e) => {
e.preventDefault()
const selectedEntities = SelectionState.getSelectedEntities()
for (const entity of selectedEntities) {
onRenameNode(entity)
}
})

const MemoTreeNode = useCallback(
(props: HierarchyTreeNodeProps) => (
<HierarchyTreeNode
Expand Down Expand Up @@ -574,6 +582,7 @@ function HierarchyPanelContents(props: { sceneURL: string; rootEntity: Entity; i
variant="transparent"
className="text-left text-xs"
onClick={() => onRenameNode(contextSelectedItem!)}
endIcon={cmdOrCtrlString + ' + r'}
>
{t('editor:hierarchy.lbl-rename')}
</Button>
Expand Down
Loading