Skip to content
Snippets Groups Projects
Commit 0d3daeb8 authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: semi-transparent viewport controls background

parent 58b1d7e0
No related branches found
No related tags found
No related merge requests found
...@@ -213,7 +213,7 @@ export namespace VolumeStreaming { ...@@ -213,7 +213,7 @@ export namespace VolumeStreaming {
}); });
this.subscribeObservable(this.plugin.behaviors.interaction.click, ({ current, buttons, modifiers }) => { this.subscribeObservable(this.plugin.behaviors.interaction.click, ({ current, buttons, modifiers }) => {
if (!Binding.match(this.params.bindings.clickVolumeAroundOnly || DefaultBindings.clickVolumeAroundOnly, buttons, modifiers)) return; if (!Binding.match((this.params.bindings && this.params.bindings.clickVolumeAroundOnly) || DefaultBindings.clickVolumeAroundOnly, buttons, modifiers)) return;
if (this.params.view.name !== 'selection-box') { if (this.params.view.name !== 'selection-box') {
this.lastLoci = this.getNormalizedLoci(current.loci); this.lastLoci = this.getNormalizedLoci(current.loci);
} else { } else {
......
...@@ -225,7 +225,16 @@ ...@@ -225,7 +225,16 @@
float: left; float: left;
margin-right: $control-spacing; margin-right: $control-spacing;
position: relative; position: relative;
background: $default-background; // background: $default-background;
> div:first-child {
position: relative;
display: inline-block;
> button {
position: relative;
}
}
.msp-animation-viewport-controls-select { .msp-animation-viewport-controls-select {
width: 290px; width: 290px;
......
...@@ -34,16 +34,17 @@ ...@@ -34,16 +34,17 @@
right: $control-spacing; right: $control-spacing;
top: $control-spacing; top: $control-spacing;
width: 32px; width: 32px;
background: $default-background;
} }
.msp-viewport-controls-buttons { .msp-viewport-controls-buttons {
text-align: right; text-align: right;
position: relative;
> button { > button {
padding: 0; padding: 0;
text-align: center; text-align: center;
width: $row-height; width: $row-height;
position: relative;
} }
.msp-btn-link-toggle-off { .msp-btn-link-toggle-off {
...@@ -55,6 +56,16 @@ ...@@ -55,6 +56,16 @@
} }
} }
.msp-semi-transparent-background {
background: $default-background;
opacity: 0.2;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.msp-viewport-controls-scene-options { .msp-viewport-controls-scene-options {
overflow-y: auto; overflow-y: auto;
max-height: 400px; max-height: 400px;
......
...@@ -223,14 +223,17 @@ export class AnimationViewportControls extends PluginUIComponent<{}, { isEmpty: ...@@ -223,14 +223,17 @@ export class AnimationViewportControls extends PluginUIComponent<{}, { isEmpty:
render() { render() {
// if (!this.state.show) return null; // if (!this.state.show) return null;
const isPlaying = this.plugin.state.snapshots.state.isPlaying; const isPlaying = this.plugin.state.snapshots.state.isPlaying;
if (isPlaying) return null; if (isPlaying || this.state.isEmpty) return null;
const isAnimating = this.state.isAnimating; const isAnimating = this.state.isAnimating;
return <div className='msp-animation-viewport-controls'> return <div className='msp-animation-viewport-controls'>
<div>
<div className='msp-semi-transparent-background' />
<IconButton icon={isAnimating || isPlaying ? 'stop' : 'tape'} title={isAnimating ? 'Stop' : 'Select Animation'} <IconButton icon={isAnimating || isPlaying ? 'stop' : 'tape'} title={isAnimating ? 'Stop' : 'Select Animation'}
onClick={isAnimating || isPlaying ? this.stop : this.toggleExpanded} onClick={isAnimating || isPlaying ? this.stop : this.toggleExpanded}
disabled={isAnimating|| isPlaying ? false : this.state.isUpdating || this.state.isPlaying || this.state.isEmpty} /> disabled={isAnimating|| isPlaying ? false : this.state.isUpdating || this.state.isPlaying || this.state.isEmpty} />
</div>
{(this.state.isExpanded && !this.state.isUpdating) && <div className='msp-animation-viewport-controls-select'> {(this.state.isExpanded && !this.state.isUpdating) && <div className='msp-animation-viewport-controls-select'>
<AnimationControls onStart={this.toggleExpanded} /> <AnimationControls onStart={this.toggleExpanded} />
</div>} </div>}
......
...@@ -76,6 +76,7 @@ export class ViewportControls extends PluginUIComponent<ViewportControlsProps, V ...@@ -76,6 +76,7 @@ export class ViewportControls extends PluginUIComponent<ViewportControlsProps, V
render() { render() {
return <div className={'msp-viewport-controls'} onMouseMove={this.onMouseMove}> return <div className={'msp-viewport-controls'} onMouseMove={this.onMouseMove}>
<div className='msp-viewport-controls-buttons'> <div className='msp-viewport-controls-buttons'>
<div className='msp-semi-transparent-background' />
{this.icon('reset-scene', this.resetCamera, 'Reset Camera')} {this.icon('reset-scene', this.resetCamera, 'Reset Camera')}
{this.icon('tools', this.toggleControls, 'Toggle Controls', this.plugin.layout.state.showControls)} {this.icon('tools', this.toggleControls, 'Toggle Controls', this.plugin.layout.state.showControls)}
{this.icon('expand-layout', this.toggleExpanded, 'Toggle Expanded', this.plugin.layout.state.isExpanded)} {this.icon('expand-layout', this.toggleExpanded, 'Toggle Expanded', this.plugin.layout.state.isExpanded)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment