From 8e2c0327d6f19eefff21b58f170b02706062e7fe Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Tue, 30 Jun 2020 21:28:53 -0700 Subject: [PATCH] added Viewport.ShowControls/Settings options to plugin config --- src/apps/viewer/index.ts | 4 ++++ src/mol-plugin-ui/viewport.tsx | 4 ++-- src/mol-plugin/config.ts | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/apps/viewer/index.ts b/src/apps/viewer/index.ts index c1fa480ab..84df41222 100644 --- a/src/apps/viewer/index.ts +++ b/src/apps/viewer/index.ts @@ -52,6 +52,8 @@ const DefaultViewerOptions = { layoutShowLeftPanel: true, viewportShowExpand: PluginConfig.Viewport.ShowExpand.defaultValue, + viewportShowControls: PluginConfig.Viewport.ShowControls.defaultValue, + viewportShowSettings: PluginConfig.Viewport.ShowSettings.defaultValue, viewportShowSelectionMode: PluginConfig.Viewport.ShowSelectionMode.defaultValue, viewportShowAnimation: PluginConfig.Viewport.ShowAnimation.defaultValue, pluginStateServer: PluginConfig.State.DefaultServer.defaultValue, @@ -94,6 +96,8 @@ export class Viewer { }, config: [ [PluginConfig.Viewport.ShowExpand, o.viewportShowExpand], + [PluginConfig.Viewport.ShowControls, o.viewportShowControls], + [PluginConfig.Viewport.ShowSettings, o.viewportShowSettings], [PluginConfig.Viewport.ShowSelectionMode, o.viewportShowSelectionMode], [PluginConfig.Viewport.ShowAnimation, o.viewportShowAnimation], [PluginConfig.State.DefaultServer, o.pluginStateServer], diff --git a/src/mol-plugin-ui/viewport.tsx b/src/mol-plugin-ui/viewport.tsx index 4080c3fd8..8f4150912 100644 --- a/src/mol-plugin-ui/viewport.tsx +++ b/src/mol-plugin-ui/viewport.tsx @@ -96,9 +96,9 @@ export class ViewportControls extends PluginUIComponent<ViewportControlsProps, V </div> <div> <div className='msp-semi-transparent-background' /> - {this.icon(BuildOutlinedSvg, this.toggleControls, 'Toggle Controls Panel', this.plugin.layout.state.showControls)} + {this.plugin.config.get(PluginConfig.Viewport.ShowControls) && this.icon(BuildOutlinedSvg, this.toggleControls, 'Toggle Controls Panel', this.plugin.layout.state.showControls)} {this.plugin.config.get(PluginConfig.Viewport.ShowExpand) && this.icon(FullscreenSvg, this.toggleExpanded, 'Toggle Expanded Viewport', this.plugin.layout.state.isExpanded)} - {this.icon(TuneSvg, this.toggleSettingsExpanded, 'Settings / Controls Info', this.state.isSettingsExpanded)} + {this.plugin.config.get(PluginConfig.Viewport.ShowSettings) && this.icon(TuneSvg, this.toggleSettingsExpanded, 'Settings / Controls Info', this.state.isSettingsExpanded)} </div> {this.plugin.config.get(PluginConfig.Viewport.ShowSelectionMode) && <div> <div className='msp-semi-transparent-background' /> diff --git a/src/mol-plugin/config.ts b/src/mol-plugin/config.ts index 23eb3d110..223d934bd 100644 --- a/src/mol-plugin/config.ts +++ b/src/mol-plugin/config.ts @@ -37,6 +37,8 @@ export const PluginConfig = { }, Viewport: { ShowExpand: item('viewer.show-expand-button', true), + ShowControls: item('viewer.show-controls-button', true), + ShowSettings: item('viewer.show-settings-button', true), ShowSelectionMode: item('viewer.show-selection-model-button', true), ShowAnimation: item('viewer.show-animation-button', true), }, -- GitLab