Browse Source

Controls Help in volume streaming controls

David Sehnal 5 years ago
parent
commit
4aca41cdbb

+ 9 - 1
src/mol-plugin-ui/structure/volume.tsx

@@ -9,6 +9,8 @@ import { InitVolumeStreaming } from '../../mol-plugin/behavior/dynamic/volume-st
 import { CollapsableControls, CollapsableState } from '../base';
 import { ApplyActionControl } from '../state/apply-action';
 import { UpdateTransformControl } from '../state/update-transform';
+import { BindingsHelp } from '../viewport/help';
+import { ExpandGroup } from '../controls/common';
 
 interface VolumeStreamingControlState extends CollapsableState {
     isBusy: boolean
@@ -49,7 +51,13 @@ export class VolumeStreamingControls extends CollapsableControls<{}, VolumeStrea
 
     renderParams() {
         const pivot = this.pivot;
-        return <UpdateTransformControl state={pivot.cell.parent} transform={pivot.volumeStreaming!.cell.transform} customHeader='none' noMargin autoHideApply />;
+        const bindings = pivot.volumeStreaming?.cell.transform.params?.entry.params.view.name === 'selection-box' && pivot.volumeStreaming?.cell.transform.params?.bindings;
+        return <>
+            <UpdateTransformControl state={pivot.cell.parent} transform={pivot.volumeStreaming!.cell.transform} customHeader='none' noMargin autoHideApply />
+            {bindings && <ExpandGroup header='Controls Help'>
+                <BindingsHelp bindings={bindings} />
+            </ExpandGroup>}
+        </>;
     }
 
     renderControls() {

+ 1 - 1
src/mol-plugin-ui/viewport/help.tsx

@@ -16,7 +16,7 @@ function getBindingsList(bindings: { [k: string]: Binding }) {
     return Object.keys(bindings).map(k => [k, bindings[k]] as [string, Binding])
 }
 
-class BindingsHelp extends React.PureComponent<{ bindings: { [k: string]: Binding } }, { isExpanded: boolean }> {
+export class BindingsHelp extends React.PureComponent<{ bindings: { [k: string]: Binding } }> {
     getBindingComponents() {
         const bindingsList = getBindingsList(this.props.bindings)
         return <>

+ 1 - 1
src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts

@@ -59,7 +59,7 @@ export namespace VolumeStreaming {
     };
 
     export const DefaultBindings = {
-        clickVolumeAroundOnly: Binding([Trigger(B.Flag.Secondary, M.create()), Trigger(B.Flag.Primary, M.create({ control: true }))], 'Show the volume around only the clicked element using ${triggers}.'),
+        clickVolumeAroundOnly: Binding([Trigger(B.Flag.Secondary, M.create()), Trigger(B.Flag.Primary, M.create({ control: true }))], 'Show Slice', 'Use ${triggers} to show volume around element.'),
     }
 
     export function createParams(options: { data?: VolumeServerInfo.Data, defaultView?: ViewTypes, binding?: typeof DefaultBindings, channelParams?: DefaultChannelParams } = { }) {