Skip to content

Commit a809494

Browse files
authored
feat: appearance needs re layout after show or hide (#171)
1 parent ce3c202 commit a809494

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

src/style/common.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $breadcrumb: prefix('breadcrumb');
3030
$search: prefix('search');
3131

3232
// ============= The Workbench core component =============
33-
$activityBar: prefix('activityBar');
33+
$compositeBar: prefix('compositeBar');
3434
$editor: prefix('editor');
3535
$menuBar: prefix('menuBar');
3636
$panel: prefix('panel');
@@ -39,6 +39,7 @@ $sidebar: prefix('sidebar');
3939
$statusBar: prefix('statusBar');
4040
$workbench: prefix('workbench');
4141
$mainBench: prefix('mainBench');
42+
$activityBar: prefix('activityBar');
4243
$notification: prefix('notification');
4344
$problems: prefix('problems');
4445

src/workbench/activityBar/style.scss

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
@import 'mo/style/common';
22

33
#{$activityBar} {
4-
bottom: 22px;
5-
left: 0;
6-
position: absolute;
7-
top: 35px;
4+
flex: 1;
5+
padding-bottom: 20px;
86
width: 48px;
9-
z-index: 1;
107

118
&__container {
129
display: flex;

src/workbench/menuBar/style.scss

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
font-size: 13px;
88
height: 35px;
99
justify-content: center;
10-
position: absolute;
1110
width: 48px;
1211

1312
&--left {

src/workbench/style.scss

+11-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33
#{$workbench} {
44
bottom: 0;
55
left: 0;
6-
padding-bottom: 22px;
76
position: absolute;
87
right: 0;
98
top: 0;
109
z-index: 1;
1110
}
1211

12+
#{$compositeBar} {
13+
display: flex;
14+
flex-direction: column;
15+
min-height: 100%;
16+
width: auto;
17+
}
18+
1319
#{$mainBench} {
14-
bottom: 22px;
15-
height: auto;
16-
left: 48px;
17-
position: absolute;
18-
right: 0;
19-
top: 0;
20+
display: flex;
21+
flex-direction: row;
22+
height: 100%;
23+
left: 0;
2024
width: auto;
2125

2226
/* stylelint-disable */

src/workbench/workbench.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { IWorkbench } from 'mo/model';
3838

3939
const mainBenchClassName = prefixClaName('mainBench');
4040
const workbenchClassName = prefixClaName('workbench');
41+
const compositeBarClassName = prefixClaName('compositeBar');
4142
const appClassName = classNames(APP_PREFIX, Utils.isMacOs() ? 'mac' : '');
4243

4344
const panelService = container.resolve<IPanelService>(PanelService);
@@ -65,9 +66,11 @@ export function WorkbenchView(props: IWorkbench & IWorkbenchController) {
6566
return (
6667
<div id={ID_APP} className={appClassName} tabIndex={0}>
6768
<div className={workbenchClassName}>
68-
{!menuBar.hidden && <MenuBarView />}
69-
{!activityBar.hidden && <ActivityBarView />}
7069
<div className={mainBenchClassName}>
70+
<div className={compositeBarClassName}>
71+
{!menuBar.hidden && <MenuBarView />}
72+
{!activityBar.hidden && <ActivityBarView />}
73+
</div>
7174
<SplitPane
7275
split="vertical"
7376
primary="first"
@@ -96,7 +99,7 @@ export function WorkbenchView(props: IWorkbench & IWorkbenchController) {
9699
? '100%'
97100
: horizontalSplitPanePos[0]
98101
}
99-
maxSize="99%"
102+
maxSize="100%"
100103
minSize="10%"
101104
>
102105
<EditorView />

0 commit comments

Comments
 (0)