feature: Add selecting a sheet object row via sequence editor
This commit is contained in:
parent
0d9d78a032
commit
1b41f1afca
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue