Skip to content

Commit 2a65a36

Browse files
committed
Renamed LeftPanelControls -> PDBeLeftPanelControls
1 parent b2aa847 commit 2a65a36

File tree

2 files changed

+8
-33
lines changed

2 files changed

+8
-33
lines changed

src/app/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import { initParamsFromHtmlAttributes } from './spec-from-html';
5353
import { subscribeToComponentEvents } from './subscribe-events';
5454
import { initSuperposition } from './superposition';
5555
import { SuperpositionFocusRepresentation } from './superposition-focus-representation';
56-
import { LeftPanelControls } from './ui/pdbe-left-panel';
56+
import { PDBeLeftPanelControls } from './ui/pdbe-left-panel';
5757
import { PDBeLigandViewStructureTools, PDBeStructureTools, PDBeSuperpositionStructureTools } from './ui/pdbe-structure-controls';
5858
import { PDBeViewportControls } from './ui/pdbe-viewport-controls';
5959
import { SuperpostionViewport } from './ui/superposition-viewport';
@@ -148,7 +148,7 @@ export class PDBeMolstarPlugin {
148148

149149
pdbePluginSpec.components = {
150150
controls: {
151-
left: LeftPanelControls,
151+
left: PDBeLeftPanelControls,
152152
},
153153
viewport: {
154154
controls: PDBeViewportControls,

src/app/ui/pdbe-left-panel.tsx

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import { SegmentTree } from './segment-tree';
1818
const _WavesIcon = <svg width='24px' height='24px' viewBox='0 0 24 24'><path d="M17 16.99c-1.35 0-2.2.42-2.95.8-.65.33-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8s-2.2.42-2.95.8c-.65.33-1.17.6-2.05.6v1.95c1.35 0 2.2-.42 2.95-.8.65-.33 1.17-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.42 2.95-.8c.65-.33 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8zm0-4.45c-1.35 0-2.2.43-2.95.8-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.38-1.57-.8-2.95-.8s-2.2.43-2.95.8c-.65.32-1.17.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.35 1.15-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.35 1.15-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.58.8 2.95.8v-1.95c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8zm2.95-8.08c-.75-.38-1.58-.8-2.95-.8s-2.2.42-2.95.8c-.65.32-1.18.6-2.05.6-.9 0-1.4-.25-2.05-.6-.75-.37-1.57-.8-2.95-.8s-2.2.42-2.95.8c-.65.33-1.17.6-2.05.6v1.93c1.35 0 2.2-.43 2.95-.8.65-.33 1.17-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V5.04c-.9 0-1.4-.25-2.05-.58zM17 8.09c-1.35 0-2.2.43-2.95.8-.65.35-1.15.6-2.05.6s-1.4-.25-2.05-.6c-.75-.38-1.57-.8-2.95-.8s-2.2.43-2.95.8c-.65.35-1.15.6-2.05.6v1.95c1.35 0 2.2-.43 2.95-.8.65-.32 1.18-.6 2.05-.6s1.4.25 2.05.6c.75.38 1.57.8 2.95.8s2.2-.43 2.95-.8c.65-.32 1.18-.6 2.05-.6.9 0 1.4.25 2.05.6.75.38 1.58.8 2.95.8V9.49c-.9 0-1.4-.25-2.05-.6-.75-.38-1.6-.8-2.95-.8z" /></svg>;
1919
export function WavesIconSvg() { return _WavesIcon; }
2020

21-
type LeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments'
21+
type PDBeLeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments'
2222

23-
export class LeftPanelControls extends PluginUIComponent<{}, { tab: LeftPanelTabName }> {
24-
state = { tab: this.plugin.behaviors.layout.leftPanelTabName.value as LeftPanelTabName };
23+
export class PDBeLeftPanelControls extends PluginUIComponent<{}, { tab: PDBeLeftPanelTabName }> {
24+
readonly state = { tab: this.plugin.behaviors.layout.leftPanelTabName.value as PDBeLeftPanelTabName };
2525

2626
componentDidMount() {
2727
this.subscribe(this.plugin.behaviors.layout.leftPanelTabName, tab => {
@@ -42,14 +42,14 @@ export class LeftPanelControls extends PluginUIComponent<{}, { tab: LeftPanelTab
4242
});
4343
}
4444

45-
set = (tab: LeftPanelTabName) => {
45+
set = (tab: PDBeLeftPanelTabName) => {
4646
if (this.state.tab === tab) {
4747
tab = 'none'; // clicking on active tab should collapse panel
4848
}
4949
this.plugin.behaviors.layout.leftPanelTabName.next(tab as any); // will update state via subscription
5050
};
5151

52-
tabs: { [K in LeftPanelTabName]: JSX.Element } = {
52+
tabs: { [K in PDBeLeftPanelTabName]: JSX.Element } = {
5353
'none': <></>,
5454
'root': <>
5555
<SectionHeader icon={HomeOutlinedSvg} title='Home' />
@@ -97,31 +97,6 @@ export class LeftPanelControls extends PluginUIComponent<{}, { tab: LeftPanelTab
9797
}
9898
}
9999

100-
// class DataIcon extends PluginUIComponent<{ set: (tab: LeftPanelTabName) => void }, { changed: boolean }> {
101-
// state = { changed: false };
102-
103-
// get tab() {
104-
// return this.plugin.behaviors.layout.leftPanelTabName.value;
105-
// }
106-
107-
// componentDidMount() {
108-
// this.subscribe(this.plugin.behaviors.layout.leftPanelTabName, tab => {
109-
// if (this.tab === 'data') this.setState({ changed: false });
110-
// else this.forceUpdate();
111-
// });
112-
113-
// this.subscribe(this.plugin.state.data.events.changed, state => {
114-
// if (this.tab !== 'data') this.setState({ changed: true });
115-
// });
116-
// }
117-
118-
// render() {
119-
// return <IconButton
120-
// svg={AccountTreeOutlinedSvg} toggleState={this.tab === 'data'} transparent onClick={() => this.props.set('data')} title='State Tree'
121-
// style={{ position: 'relative' }} extraContent={this.state.changed ? <div className='msp-left-panel-controls-button-data-dirty' /> : void 0} />;
122-
// }
123-
// }
124-
125100
class FullSettings extends PluginUIComponent {
126101
private setSettings = (p: { param: PD.Base<any>, name: string, value: any }) => {
127102
PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: { [p.name]: p.value } });
@@ -201,4 +176,4 @@ class SuperpositionHelpContent extends PluginUIComponent {
201176
</HelpGroup>
202177
</div>;
203178
}
204-
}
179+
}

0 commit comments

Comments
 (0)