@@ -18,10 +18,10 @@ import { SegmentTree } from './segment-tree';
18
18
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 > ;
19
19
export function WavesIconSvg ( ) { return _WavesIcon ; }
20
20
21
- type LeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments'
21
+ type PDBeLeftPanelTabName = 'none' | 'root' | 'data' | 'states' | 'settings' | 'help' | 'segments'
22
22
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 } ;
25
25
26
26
componentDidMount ( ) {
27
27
this . subscribe ( this . plugin . behaviors . layout . leftPanelTabName , tab => {
@@ -42,14 +42,14 @@ export class LeftPanelControls extends PluginUIComponent<{}, { tab: LeftPanelTab
42
42
} ) ;
43
43
}
44
44
45
- set = ( tab : LeftPanelTabName ) => {
45
+ set = ( tab : PDBeLeftPanelTabName ) => {
46
46
if ( this . state . tab === tab ) {
47
47
tab = 'none' ; // clicking on active tab should collapse panel
48
48
}
49
49
this . plugin . behaviors . layout . leftPanelTabName . next ( tab as any ) ; // will update state via subscription
50
50
} ;
51
51
52
- tabs : { [ K in LeftPanelTabName ] : JSX . Element } = {
52
+ tabs : { [ K in PDBeLeftPanelTabName ] : JSX . Element } = {
53
53
'none' : < > </ > ,
54
54
'root' : < >
55
55
< SectionHeader icon = { HomeOutlinedSvg } title = 'Home' />
@@ -97,31 +97,6 @@ export class LeftPanelControls extends PluginUIComponent<{}, { tab: LeftPanelTab
97
97
}
98
98
}
99
99
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
-
125
100
class FullSettings extends PluginUIComponent {
126
101
private setSettings = ( p : { param : PD . Base < any > , name : string , value : any } ) => {
127
102
PluginCommands . Canvas3D . SetSettings ( this . plugin , { settings : { [ p . name ] : p . value } } ) ;
@@ -201,4 +176,4 @@ class SuperpositionHelpContent extends PluginUIComponent {
201
176
</ HelpGroup >
202
177
</ div > ;
203
178
}
204
- }
179
+ }
0 commit comments