feature: Add selecting a sheet object row via sequence editor

This commit is contained in:
Cole Lawrence 2022-06-07 15:49:52 -04:00 committed by Aria
parent 0d9d78a032
commit 1b41f1afca

View file

@ -4,6 +4,7 @@ import React from 'react'
import AnyCompositeRow from './AnyCompositeRow'
import {decideRowByPropType} from './PropWithChildrenRow'
import {setCollapsedSheetObjectOrCompoundProp} from '@theatre/studio/panels/SequenceEditorPanel/DopeSheet/setCollapsedSheetObjectOrCompoundProp'
import getStudio from '@theatre/studio/getStudio'
const LeftSheetObjectRow: React.VFC<{
leaf: SequenceEditorTree_SheetObject
@ -14,6 +15,14 @@ const LeftSheetObjectRow: React.VFC<{
leaf={leaf}
label={leaf.sheetObject.address.objectKey}
isCollapsed={leaf.isCollapsed}
toggleSelect={() => {
// set selection to this sheet object on click
getStudio().transaction(({stateEditors}) => {
stateEditors.studio.historic.panels.outline.selection.set([
leaf.sheetObject,
])
})
}}
toggleCollapsed={() =>
setCollapsedSheetObjectOrCompoundProp(!leaf.isCollapsed, leaf)
}