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

Commit

Permalink
rename hierarchy node using hotkey (#10963)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Mazer <[email protected]>
  • Loading branch information
aditya-mitra and SamMazerIR authored Aug 16, 2024
1 parent 97044a8 commit 5994131
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 5994131

Please sign in to comment.