File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,17 @@ import { singleton } from 'tsyringe';
3
3
4
4
export interface IWorkbenchController {
5
5
readonly splitPanePos : string [ ] ;
6
+ readonly horizontalSplitPanePos : string [ ] ;
6
7
onPaneSizeChange ?: ( newSize : number ) => void ;
8
+ onHorizontalPaneSizeChange ?: ( newSize : number ) => void ;
7
9
}
8
-
9
10
@singleton ( )
10
11
export class WorkbenchController
11
12
extends Controller
12
13
implements IWorkbenchController {
13
14
// Group Pos locate here temporary, we can move it to state or localStorage in future.
14
15
public splitPanePos : string [ ] = [ '300px' , 'auto' ] ;
16
+ public horizontalSplitPanePos : string [ ] = [ '70%' , 'auto' ] ;
15
17
16
18
constructor ( ) {
17
19
super ( ) ;
@@ -20,4 +22,7 @@ export class WorkbenchController
20
22
public onPaneSizeChange = ( newSize ) => {
21
23
this . splitPanePos = newSize ;
22
24
} ;
25
+
26
+ public onHorizontalPaneSizeChange = ( newSize ) =>
27
+ ( this . horizontalSplitPanePos = newSize ) ;
23
28
}
Original file line number Diff line number Diff line change @@ -57,9 +57,10 @@ export function WorkbenchView(props: IWorkbench & IWorkbenchController) {
57
57
sideBar,
58
58
statusBar,
59
59
onPaneSizeChange,
60
+ onHorizontalPaneSizeChange,
60
61
splitPanePos,
62
+ horizontalSplitPanePos,
61
63
} = props ;
62
-
63
64
return (
64
65
< div id = { ID_APP } className = { appClassName } tabIndex = { 0 } >
65
66
< div className = { workbenchClassName } >
@@ -85,10 +86,15 @@ export function WorkbenchView(props: IWorkbench & IWorkbenchController) {
85
86
primary = "first"
86
87
split = "horizontal"
87
88
allowResize = { true }
89
+ onChange = { onHorizontalPaneSizeChange }
88
90
>
89
91
{ ! panel . maximize ? (
90
92
< Pane
91
- initialSize = "70%"
93
+ initialSize = {
94
+ panel . hidden
95
+ ? '100%'
96
+ : horizontalSplitPanePos [ 0 ]
97
+ }
92
98
maxSize = "99%"
93
99
minSize = "10%"
94
100
>
You can’t perform that action at this time.
0 commit comments