@@ -16,6 +16,8 @@ import { APP_PREFIX } from 'mo/common/const';
16
16
import { panelService } from 'mo/services' ;
17
17
import { connect } from 'mo/react' ;
18
18
import { IPanel } from 'mo/model/workbench/panel' ;
19
+ import { workbenchController } from 'mo/controller' ;
20
+ import { IWorkbenchController } from 'mo/controller/workbench' ;
19
21
20
22
export interface IWorkbench {
21
23
panel : IPanel ;
@@ -25,8 +27,9 @@ const mainBenchClassName = prefixClaName('mainBench');
25
27
const workbenchClassName = prefixClaName ( 'workbench' ) ;
26
28
const appClassName = classNames ( APP_PREFIX , Utils . isMacOs ( ) ? 'mac' : '' ) ;
27
29
28
- export function WorkbenchView ( props : IWorkbench ) {
29
- const { panel } = props ;
30
+ export function WorkbenchView ( props : IWorkbench & IWorkbenchController ) {
31
+ const { panel, onPaneSizeChange, splitPanePos } = props ;
32
+
30
33
return (
31
34
< div id = { ID_APP } className = { appClassName } >
32
35
< div className = { workbenchClassName } >
@@ -37,8 +40,13 @@ export function WorkbenchView(props: IWorkbench) {
37
40
split = "vertical"
38
41
primary = "first"
39
42
allowResize = { true }
43
+ onChange = { onPaneSizeChange }
40
44
>
41
- < Pane minSize = "170px" initialSize = "300px" maxSize = "80%" >
45
+ < Pane
46
+ minSize = "170px"
47
+ initialSize = { splitPanePos [ 0 ] }
48
+ maxSize = "80%"
49
+ >
42
50
< SidebarView />
43
51
</ Pane >
44
52
< SplitPane
@@ -69,6 +77,10 @@ export function WorkbenchView(props: IWorkbench) {
69
77
) ;
70
78
}
71
79
72
- export const Workbench = connect ( { panel : panelService } , WorkbenchView ) ;
80
+ export const Workbench = connect (
81
+ { panel : panelService } ,
82
+ WorkbenchView ,
83
+ workbenchController
84
+ ) ;
73
85
74
86
export default Workbench ;
0 commit comments